Permalink
Browse files

fixed an Orientation-Issue on iOS6

  • Loading branch information...
1 parent f8a43fd commit 8b91d39859ec6a68ad247bb086bc34c8ae0e519d @messi messi committed Dec 20, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 MTZoomWindow.m
View
@@ -77,6 +77,15 @@ - (id)initWithFrame:(CGRect)frame {
_zoomGestureRecognizers = [NSMutableSet set];
// using setter on purpose here
self.zoomGestures = MTZoomGestureTap | MTZoomGesturePinch;
+
+ // iOS 6 Hacks: willChange and didChange won't get called after launching the Application
+ UIInterfaceOrientation statusBarOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+ if (UIInterfaceOrientationIsLandscape(statusBarOrientation)) {
+ [self setupForOrientation:UIInterfaceOrientationPortraitUpsideDown forceLayout:YES];
+ } else if (statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown) {
+ [self setupForOrientation:UIInterfaceOrientationPortrait forceLayout:YES];
+ }
+ self.frame = [UIScreen mainScreen].bounds;
// register for orientation change notification
[[NSNotificationCenter defaultCenter] addObserver:self

0 comments on commit 8b91d39

Please sign in to comment.