Created
March 27, 2012 04:32
-
-
Save sodastsai/2212557 to your computer and use it in GitHub Desktop.
UIView 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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| self.window.backgroundColor = [UIColor whiteColor]; | |
| [self.window makeKeyAndVisible]; | |
| UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; | |
| view.backgroundColor = [UIColor yellowColor]; | |
| [self.window addSubview:view]; | |
| void (^keyframe1)(void) = ^{ | |
| view.frame = CGRectMake(100,100,100,100); | |
| view.backgroundColor = [UIColor redColor]; | |
| }; | |
| void (^keyframe2)(void) = ^{ | |
| view.backgroundColor = [UIColor blackColor]; | |
| }; | |
| [UIView animateWithDuration:3 animations:keyframe1 completion:^(BOOL finished) { | |
| [UIView animateWithDuration:3 animations:keyframe2]; | |
| }]; | |
| return YES; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment