I only recently started programming for iOS (in Objective C). I am pretty new to most concepts of iOS programming. I've been able to get by with Tutorials and stackoverflow threads, but now I've run into a wall. I am using the Storyboard to build my interface, so right now I have this set-up:
I have a standard "View Controller" which contains a "Container View" and two buttons. The Container View embeds a "Page View Controller".
How do I now use the buttons in the Parent "View Controller" to execute methods in the "Page View Controller"? I have heard of Delegation or working with Selectors, but I really don't understand how either of those would work in code.
Thank you in advance!
@property (nonatomic, assign) UIPageViewController *pageVC;
prepareForSegue
method in view controller and access the segue's destination view controller to assign it to the local property -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"segueIdentifier"]) {
if ([segue.destinationViewController isKindOfClass:[UIPageViewController class]]) {
self.pageVC = (UIPageViewController *)segue.destinationViewController;
}
}
}
Once the segue is executed, you can directly access the embedded page view controller form the main view controller.