In my main view controller, an NSTimer calls the function below after a specified delay:
-(void)showAdView{
[self performSegueWithIdentifier:@"ShowAdSegue" sender:nil];
}
This modally presents MyAdViewController, and I’d like the MyAdViewController class to have a MyAdViewControllerDelegate protocol, so that I can implement an adViewDidFinish function in my main view controller.
Is it possible to do that without creating a new instance of MyAdViewController in the main view controller?
You can do the following:
For this to work you have to include your view controller header file in the view controller executing the segue and also make the delegate property of your
MyAdViewControllerpublic by adding it to the header file of the class.