Wednesday, June 09, 2010

iPhone dev Stupidity 123: How to launch iPhone Camera on viewDidL


You should do it in viewWillAppear:, or viewDidAppear: if the first doesn't work. trying to do it in viewDidLoad won't work because that is called after the view is first created, and the view isn't a subview of anything else at that point. 

As far as i understand it, in order to call presentModalViewController on self, the view must at some level be displayed in the UIWindow.

And some solutions on camera shutter animation:



The movie files are too big ~ 7MB ~ to fit here.


UIImageView animationImages

imageView.animationImages = [NSArray arrayWithObjects:
                                     
[UIImage imageNamed:@"cameraScreenOverlay1.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay2.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay3.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay4.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay4.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay4.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay3.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay2.png"],
                                     
[UIImage imageNamed:@"cameraScreenOverlay1.png"],
                                     
nil];
        imageView
.animationDuration = 1.0;
        imageView
.animationRepeatCount = 0;
       
[imageView startAnimating];

doesn't work when imageView is used as an overlay view above camera.


Not sure how he had done it - snapshoting each frame of the camera animation?

No comments: