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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]