Last active
January 3, 2016 09:08
-
-
Save steipete/8440278 to your computer and use it in GitHub Desktop.
Prevent iOS 7 from messing with our contentInset.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// This view exists purely so that iOS 7 stops messing with our PSPDFScrollView. | |
// If this doesn't exist and the parent didn't set `automaticallyAdjustsScrollViewInsets` to NO, then the view doesn't stay fixed anymore. | |
// This is better than enforcing disabling this property on the parent - since we don't even know who our parent is. | |
UIView *fakeView = [[UIView alloc] initWithFrame:CGRectZero]; | |
fakeView.backgroundColor = UIColor.clearColor; | |
fakeView.userInteractionEnabled = NO; | |
[self.view addSubview:fakeView]; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment