Skip to content

Instantly share code, notes, and snippets.

@minsOne
Created June 30, 2014 07:27
Show Gist options
  • Select an option

  • Save minsOne/011ca9ad6095852085f5 to your computer and use it in GitHub Desktop.

Select an option

Save minsOne/011ca9ad6095852085f5 to your computer and use it in GitHub Desktop.
UIViewController willRotateToInterfaceOrientation:duration:]
[UIViewController viewWillLayoutSubviews]
[UIView layoutSubviews]
[UIViewController viewDidLayoutSubviews]
[UIViewController willAnimateRotationToInterfaceOrientation:duration:]
[UIViewController shouldAutorotateToInterfaceOrientation:]
[UIViewController didRotateFromInterfaceOrientation:]
And when presenting a view controller we get the following:
[UIViewController loadView]
[UIViewController viewDidLoad]
[UIViewController viewWillAppear:]
[UIViewController shouldAutorotateToInterfaceOrientation:]
[UIViewController viewWillLayoutSubviews]
[UIView layoutSubviews]
[UIViewController viewDidLayoutSubviews]
[UIViewController viewDidAppear:]
And finally dismissing a view controller (when orientation was changed in the child view controller):
[UIViewController viewWillAppear:] - Note correct bounds here
[UIViewController viewWillLayoutSubviews]
[UIView layoutSubviews]
[UIViewController viewDidLayoutSubviews]
[UIViewController viewDidAppear:]
http://kevindew.me/post/18579273258/where-to-progmatically-lay-out-views-in-ios-5-and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment