Guest User

Untitled

a guest
Sep 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  2. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  3. self.window.backgroundColor = [UIColor whiteColor];
  4. [self.window makeKeyAndVisible];
  5.  
  6. UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  7. view.backgroundColor = [UIColor yellowColor];
  8. [self.window addSubview:view];
  9.  
  10. void (^keyframe1)(void) = ^{
  11. view.frame = CGRectMake(100,100,100,100);
  12. view.backgroundColor = [UIColor redColor];
  13. };
  14. void (^keyframe2)(void) = ^{
  15. view.backgroundColor = [UIColor blackColor];
  16. };
  17.  
  18. [UIView animateWithDuration:3 animations:keyframe1 completion:^(BOOL finished) {
  19. [UIView animateWithDuration:3 animations:keyframe2];
  20. }];
  21.  
  22. return YES;
  23. }
Add Comment
Please, Sign In to add comment