Skip to content

Commit

Permalink
Added iOS 5 rotation code
Browse files Browse the repository at this point in the history
necessary for building to both OS's
  • Loading branch information
brianensorapps committed Oct 6, 2012
1 parent 4c65dd7 commit ead2878
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions samples/scaffold/src/Classes/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ - (NSUInteger)supportedInterfaceOrientations
return returnOrientations;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
NSArray *supportedOrientations =
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"];

return ((interfaceOrientation == UIInterfaceOrientationPortrait &&
[supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"]) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeLeft &&
[supportedOrientations containsObject:@"UIInterfaceOrientationLandscapeLeft"]) ||
(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown &&
[supportedOrientations containsObject:@"UIInterfaceOrientationPortraitUpsideDown"]) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight &&
[supportedOrientations containsObject:@"UIInterfaceOrientationLandscapeRight"]));
}

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
duration:(NSTimeInterval)duration
{
Expand Down

0 comments on commit ead2878

Please sign in to comment.