Skip to content

Instantly share code, notes, and snippets.

@jdriscoll
Created February 7, 2013 17:12
Show Gist options
  • Select an option

  • Save jdriscoll/4732483 to your computer and use it in GitHub Desktop.

Select an option

Save jdriscoll/4732483 to your computer and use it in GitHub Desktop.
This is the best way I've found so far to handle one time setup that requires the view already be laid out (so no viewWillAppear) when using auto layout.
@property (nonatomic, assign) BOOL viewHasInitialLayout;
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
if (!self.viewHasInitialLayout) {
// Do stuff
self.viewHasInitialLayout = YES;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment