Customizing UIPageViewController during init
Customizing UIPageViewController during init
- Subject: Customizing UIPageViewController during init
- From: Steve Mills <email@hidden>
- Date: Wed, 24 May 2017 10:17:26 -0500
I have a UIPageViewController subclass that's loaded from a storyboard. Depending on user settings, it will display either 1 or 2 pages at a time. There doesn't seem to be a way to manually set the spine location programmatically (except for the delegate method pageViewController:spineLocationForInterfaceOrientation:, which isn't called during loading). One thing I tried - and it seems to work fine - is this:
@implementation MyViewController
-(instancetype) initWithCoder:(NSCoder*)coder
{
self = [super initWithCoder:coder];
if(self) {
self = [super initWithTransitionStyle:self.transitionStyle navigationOrientation:self.navigationOrientation options:@{UIPageViewControllerOptionSpineLocationKey:@(UIPageViewControllerSpineLocationMid)}];
}
return self;
}
@end
Is it wrong to call two different init methods? Seems like it depends on the implementation of each, which is a mystery to anyone not on the UIPageViewController team. How have others customized their UIPageViewControllers at load time?
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden