This file contains hidden or 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 *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
[animation setFromValue:[NSNumber numberWithFloat:1.0]]; | |
[animation setToValue:[NSNumber numberWithFloat:0.0]]; | |
[animation setDuration:0.5f]; | |
[animation setTimingFunction:[CAMediaTimingFunction | |
functionWithName:kCAMediaTimingFunctionLinear]]; | |
[animation setAutoreverses:YES]; | |
[animation setRepeatCount:20000]; | |
[[view layer] addAnimation:animation forKey:@"opacity"]; |
This file contains hidden or 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
// Get all the fonts on the system | |
NSArray *familyNames = [UIFont familyNames]; | |
for( NSString *familyName in familyNames ){ | |
printf( "Family: %s \n", [familyName UTF8String] ); | |
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; | |
for( NSString *fontName in fontNames ){ | |
printf( "\tFont: %s \n", [fontName UTF8String] ); | |
} | |
} |
This file contains hidden or 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
git rm $(git ls-files --deleted) |
This file contains hidden or 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
UIGraphicsBeginImageContext(webview.frame.size); | |
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); |
This file contains hidden or 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
a: AM/PM | |
A: 0~86399999 (Millisecond of Day) | |
c/cc: 1~7 (Day of Week) | |
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
d: 1~31 (0 padded Day of Month) | |
D: 1~366 (0 padded Day of Year) | |
This file contains hidden or 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
To remove a submodule you need to: | |
Delete the relevant line from the .gitmodules file. | |
Delete the relevant section from .git/config. | |
Run git rm --cached path_to_submodule (no trailing slash). | |
Commit and delete the now untracked submodule files. |
This file contains hidden or 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
CATransition *transition = [CATransition animation]; | |
transition.duration = 0.35f; | |
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
transition.type = kCATransitionFade; | |
[logoView.layer addAnimation:transition forKey:nil]; |
This file contains hidden or 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 *bounceAnimation = [CABasicAnimation animationWithKeyPath:@"position.y"]; | |
bounceAnimation.duration = .75; | |
bounceAnimation.speed = 1.25; | |
bounceAnimation.fromValue = [NSNumber numberWithInt:0]; | |
bounceAnimation.toValue = [NSNumber numberWithInt:-15]; | |
bounceAnimation.repeatCount = INT_MAX; | |
bounceAnimation.autoreverses = YES; | |
bounceAnimation.fillMode = kCAFillModeForwards; | |
bounceAnimation.removedOnCompletion = NO; | |
bounceAnimation.additive = YES; |
This file contains hidden or 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
CATransition *transition = [CATransition animation]; | |
transition.duration = 1.0f; | |
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
transition.type = kCATransitionFade; | |
[imageView.layer addAnimation:transition forKey:nil]; |
This file contains hidden or 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
if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){ | |
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault]; | |
} |
NewerOlder