Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Created July 2, 2015 16:57
Show Gist options
  • Save mikeabdullah/2a7e49d54b95826ddda9 to your computer and use it in GitHub Desktop.
Save mikeabdullah/2a7e49d54b95826ddda9 to your computer and use it in GitHub Desktop.
Locating child View Controllers based on containing view
- (void)viewDidLoad {
[super viewDidLoad];
for (NSViewController *aController in self.childViewControllers) {
if ([aController.view isDescendantOf:self.containerView]) {
self.contentViewController = aController;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment