Skip to content

Instantly share code, notes, and snippets.

@tarnfeld
Created February 25, 2012 12:56
Show Gist options
  • Save tarnfeld/1908387 to your computer and use it in GitHub Desktop.
Save tarnfeld/1908387 to your computer and use it in GitHub Desktop.
View controller rotation for page view controller child view controllers
#import <UIKit/UIKit.h>
@interface MMPageViewController : UIPageViewController
@end
#import "MMPageViewController.h"
@implementation MMPageViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self.viewControllers enumerateObjectsUsingBlock:^(UIViewController *viewController, NSUInteger idx, BOOL *stop) {
[viewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment