Skip to content

Instantly share code, notes, and snippets.

@steipete
Last active January 3, 2016 09:08
Show Gist options
  • Save steipete/8440278 to your computer and use it in GitHub Desktop.
Save steipete/8440278 to your computer and use it in GitHub Desktop.
Prevent iOS 7 from messing with our contentInset.
- (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