• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Customizing UIPageViewController during init
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Customizing UIPageViewController during init
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: inactive menu item
  • Next by Date: number formatter
  • Previous by thread: Re: inactive menu item
  • Next by thread: Re: Customizing UIPageViewController during init
  • Index(es):
    • Date
    • Thread