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
| float angle = 90 * (3.14 / 100); | |
| CGAffineTransform transform = CGAffineTransformMakeRotation(angle); | |
| button.transform = transform; |
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
| CGSize textSize = [[label text] sizeWithFont:[label font]]; |
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 *animation = [CATransition animation]; | |
| animation.delegate = self; | |
| animation.duration = 0.5f; | |
| animation.type = kCATransitionMoveIn; | |
| animation.subtype = kCATransitionFromTop; | |
| [self.view.layer addAnimation:animation forKey:@"animation"]; |
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
| typedef void (^AnimationBlock)(void); | |
| typedef void (^CompletionBlock)(BOOL finished); | |
| // | |
| // AnimationBlock | |
| AnimationBlock first = ^(void){ | |
| self.transform = CGAffineTransformMakeScale(0.5f, 0.5f); | |
| }; | |
| AnimationBlock second = ^(void){ | |
| self.transform = CGAffineTransformMakeScale(1.15f, 1.15f); |
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
| - (UIImage*) buildSwatch: (int) aBrightness | |
| { | |
| CGRect rect = CGRectMake(0.0f, 0.0f, 30.0f, 30.0f); | |
| UIGraphicsBeginImageContext(rect.size); | |
| UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:4.0f]; | |
| [[[UIColor blackColor] colorWithAlphaComponent:(float) aBrightness / 10.0f] set]; | |
| [path fill]; | |
| UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); |
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
| #import <QuartzCore/QuartzCore.h> | |
| [v.layer setCornerRadius:25.0f]; | |
| [v.layer setMasksToBounds: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
| CGFloat startDeg = 0; | |
| CGFloat endDeg = 360; | |
| CGContextAddArc(context, 100.0, 100.0, 90.0, (startDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0); |
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
| - (BOOL)shouldAutorotate { | |
| return YES; | |
| } | |
| - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { | |
| // Move the Labels into place | |
| switch ([UIDevice currentDevice].orientation) { | |
| case UIDeviceOrientationLandscapeLeft: | |
| case UIDeviceOrientationLandscapeRight: | |
| { |
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
| clock.layer.shadowColor = [[UIColor redColor] CGColor]; | |
| clock.layer.shadowRadius = 4.0f; | |
| clock.layer.shadowOpacity = 0.9f; | |
| clock.layer.shadowOffset = CGSizeZero; | |
| clock.layer.masksToBounds = NO; |
OlderNewer