Mimicking iOS 6 camera rotation - objective-c

I have been doing some experiments with a custom camera using AVFoundation and so far everything's been great. The AVCam example got me very far and I am quite happy with the results.
However, one thing I still don't get is how the iOS default Camera app handles rotations. It seems like the background does not rotate at all but all the overlay controls do.
This is probably not a camera-specific question but how could I achieve this behaviour?
TLDR: Have a background camera layer, controls on top, how to rotate controls without rotating the background layer?

I've been wondering on the same...
My guess would be that the native Camera viewController doesn't rotate using the UIViewController rotation mechanism
no status bar rotation
no 'basic' rotation of subviews - toolbar doesn't move, buttons are animated
and of course the view containing the camera preview doesn't rotate :)
Rather it must call [UIDevice beginGeneratingDeviceOrientationNotifications] and handle specific UI update (grey buttons fading position switching, and toolbar buttons image rotation)
[[NSNotificationCenter defaultCenter] addObserver:self selector:#selector(yourUpdateMethodForRotation:) notificationName: UIDeviceOrientationDidChangeNotification];

Related

how to do a "app launch like" fade - zoom ios 7 transition?

I need to achieve the IOS7 app launch transition, in which the the detail view appears with fade effect according to the rectangle frame of the button that fired this view, as described in the image below:
So I have a main ViewController with six buttons, I want to make transition to the details viewControllers with fade and zoom effect, and starting the animation depending of the button frame.
I found RZTransitions, amazing collection of custom transitions, it does exactly what I want but for uicollectionView, I tried but can't get working to do the same for a viewController.
Thanks.

Detect how far the keyboard has animated?

I would like it to appear the keyboard is pushing another view up. The problem is there is a UITabbar between the UIView I would like to animate in unison with the keyboard, problem being the UITabbar breaks up what would give that appearance. What I would really like to be able to do is detect when the keyboard is at the exact point my view then animate that view.
Is this possible without going into the private API's?
Too be clear I have the animation working, just working out a way to make it smoother. The effect I am trying to create is similar to the messages app, but there is a UITabbar between to UIView and the bottom of the screen.
Perhaps this will work...
The height of the keyboard on the iPhone is 216 pixels. The default animation duration for the keyboard display is 0.25 seconds.
The height for a tab bar is 44 pixels.
So, if you started the UIView transition animation afterDelay:((44.0/216.0) * 0.25), this should look right on an iPhone. Perhaps try and see?
If this works, it's pretty easy how to figure out for landscape, and iPad, etc.
Additionally, if this does work, in your final implementation, I would avoid hardcoding the 0.25.

UIButton - UIImage bounce

Do you know how to make this buttons bounce?
http://www.youtube.com/watch?v=Ku1lB9etiN8
They used some of the UIView animateWithDuration methods. My guess is that that started the buttons behind the large green button, animated them to spin, then animated their position. This is a custom thing they built, and you'll have to build it from scratch as well.

animated sprite images in navigation bar buttons

Working on an iOS app right now - was curious to if it is possible to use an animated sprite for a button in the Top Nav Bar. For example, having the hands on a clock button continually turn via a looped animation (like a web GIF - but better). Is this possible, and if so, how difficult is it?
Thanks!
Zach
Check out the animatedImageNamed:duration: and animatedImageWithImages:duration: methods of UIImage. You will have to put each frame of each sprite in a separate file, or (if you don't want to split up your animated GIF) use the ImageIO framework to create separate UIImage objects for each frame in the GIF.

Rotating the buttons in app when I rotate the iPad upside down

I'm programming an iPad application and I just wrote the rotate methods and there are some buttons. I used CGRectMake method and re-positioned buttons ... portrait and landscape modes all works fine but my problem is buttons are not re-positioned when I turn my ipad upside down. Need Help
UIDeviceOrientationPortraitUpsidedown is the solution