I have UIPageViewController related app made using http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/
How can i change the title of the UIButton when UI comes to last page, and the UIButton is in the UIViewController which contains UIPageViewController?
Thanks
Having read through the tutorial, here's what you need to do:
@property NSString *buttonText;
if (self.buttonText != nil) { [self.button setTitle:self.buttonText forState:UIControlStateNormal]; }
To do this, after the page index is set, you could do something like this:
// other initialization pageContentViewController.pageIndex = index; if (index == [self.pageTitles count] - 1) { pageContentViewController.buttonText = @"Your special text"; }
Because the button's natural text will only be overwritten if it's set, it should only change the text if the user is on the last page!