Skip to content

Instantly share code, notes, and snippets.

@geek1706
Forked from steipete/workaround.m
Created May 15, 2017 07:59
Show Gist options
  • Save geek1706/b6c9a98e73b2ab8082ef9575aa06ec53 to your computer and use it in GitHub Desktop.
Save geek1706/b6c9a98e73b2ab8082ef9575aa06ec53 to your computer and use it in GitHub Desktop.
If you're implementing child view controllers and want automaticallyAdjustsScrollViewInsets to work...
// This ensures that the automaticallyAdjustsScrollViewInsets magic works
// On our newly added view controller as well.
// This triggers _layoutViewController which then triggers
// _computeAndApplyScrollContentInsetDeltaForViewController:
// which finally updates our content inset of the scroll view (if any)
// rdar://19053416
[self.navigationController.view setNeedsLayout];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment