Alex
Alex

Reputation: 11

iOS return PageViewController instance from UIViewController

In my app I have a PageViewController to manage more different layout. Is there a way to allow to the instance of PageViewController from one of the content page(UIViewController)?

Upvotes: 0

Views: 159

Answers (2)

Alex
Alex

Reputation: 11

Thanks but I've already tried but I can't cast it because when I call a method of the PageViewController I get an exception.

However I resolved passing the instance of the PageViewController when I call the content.

Upvotes: 0

user1459524
user1459524

Reputation: 3603

You should be able to just do

self.parentViewController

Or even explicitly cast it to

(UIPageViewController *)self.parentViewController

Upvotes: 1

Related Questions