Guest User

Untitled

a guest
Jul 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. [super viewDidLoad];
  4.  
  5. self.title = NSLocalizedString(@"TransitionsTitle", @"");
  6.  
  7. // create the container view which we will use for transition animation (centered horizontally)
  8. CGRect frame = CGRectMake(round((self.view.bounds.size.width - kImageWidth) / 2.0),kTopPlacement, kImageWidth, kImageHeight);
  9. self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease];
  10. [self.view addSubview:self.containerView];
  11.  
  12. // create the initial image view
  13. frame = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  14. self.mainView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
  15. self.mainView.image = [UIImage imageNamed:@"img11.jpeg"];
  16. [self.containerView addSubview:self.mainView];
  17.  
  18. // create the alternate image view (to transition between)
  19. CGRect imageFrame = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  20. self.curlToView = [[[UIImageView alloc] initWithFrame:imageFrame] autorelease];
  21. self.curlToView.image = [UIImage imageNamed:@"img12.jpeg"];
  22.  
  23. frame1 = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  24. self.curlToView = [[[UIImageView alloc] initWithFrame:frame1] autorelease];
  25. self.curlToView.image = [UIImage imageNamed:@"img13.jpeg"];
  26.  
  27. CGRect imageFrame1 = CGRectMake(0.0, 0.0, kImageWidth, kImageHeight);
  28. self.curlToView = [[[UIImageView alloc] initWithFrame:imageFrame1] autorelease];
  29. self.curlToView.image = [UIImage imageNamed:@"img14.jpeg"];
  30. }
Add Comment
Please, Sign In to add comment