Skip to content

Commit

Permalink
fixed an Orientation-Issue on iOS6
Browse files Browse the repository at this point in the history
  • Loading branch information
messi committed Dec 20, 2012
1 parent f8a43fd commit 8b91d39
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions MTZoomWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b91d39

Please sign in to comment.