Guest User

Untitled

a guest
Jul 16th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  viewWillAppear
  2.  viewWillDisappear
  3.  viewDidAppear
  4.  viewDidDisappear
  5.  
  6.  viewDidLoad
  7.  viewDidUnload
  8.  viewWillUnload
  9.  
  10. – viewDidUnload Deprecated in iOS 6.0
  11. – viewWillUnload Deprecated in iOS 6.0
  12.  
  13. Configuring a GLKit view
  14. - (void)viewDidLoad
  15. {
  16.     [super viewDidLoad];
  17.  
  18.     // Create an OpenGL ES context and assign it to the view loaded from storyboard
  19.     GLKView *view = (GLKView *)self.view;
  20.     view.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
  21.  
  22.     // Configure renderbuffers created by the view
  23.     view.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888;
  24.     view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
  25.     view.drawableStencilFormat = GLKViewDrawableStencilFormat8;
  26.  
  27.     // Enable multisampling
  28.     view.drawableMultisample = GLKViewDrawableMultisample4X;
  29. }
  30.  
  31.  
  32. Simple Core Animations 3D transform of UIView
  33.  
  34. CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
  35. rotationAndPerspectiveTransform.m34 = 1.0 / -1000.0;
  36. rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI * 0.6, 1.0f, 0.0f, 0.0f);
  37. [UIView animateWithDuration:1.0 animations:^{
  38.     self.someView.layer.anchorPoint = CGPointMake(0.5, 0);
  39.     self.someView.layer.transform = rotationAndPerspectiveTransform;
  40. } completion:^(BOOL finished){
  41.     // code to be executed when flip is completed
  42. }];
Advertisement
Add Comment
Please, Sign In to add comment