This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CreateExpression() | |
{ | |
Type argType = typeof (MyClass); | |
string propertyName = "Name"; | |
ParameterExpression paramExpression = Expression.Parameter(argType, "item"); | |
//Create "item.Name" and "item.GetType()" expressions | |
var propertyAccessExpression = Expression.Property(paramExpression, propertyName); | |
var getTypeExpression = Expression.Call(paramExpression, "GetType", Type.EmptyTypes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CABasicAnimation *theAnimation; | |
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; | |
theAnimation.duration=1; | |
theAnimation.repeatCount=2; | |
theAnimation.autoreverses=YES; | |
theAnimation.fromValue=[NSNumber numberWithFloat:0]; | |
theAnimation.toValue=[NSNumber numberWithFloat:-60]; | |
[view.layer addAnimation:theAnimation forKey:@"animateLayer"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIView animateWithDuration:0.3 animations:^() { | |
self.commentContentLabel.alpha = (editing)? 0.0 : 1.0; | |
}]; | |
//////////////// | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:1.0]; | |
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.commentContentLabel cache:YES]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//current date | |
NSDate* date = [NSDate date]; | |
//conversion to unix representation | |
NSTimeInterval time = [date timeIntervalSince1970]; | |
NewerOlder