Re: How to make UISplitViewController behave ?
Re: How to make UISplitViewController behave ?
- Subject: Re: How to make UISplitViewController behave ?
- From: David Duncan <email@hidden>
- Date: Mon, 12 Oct 2015 14:49:11 -0700
> On Oct 11, 2015, at 11:21 PM, Gerriet M. Denkmann <email@hidden> wrote:
>
> iPad / iPhone Master-Detail app. iOS 9.0, Xcode 7.0
>
> Rotating the iPad to Portrait my AppDelegate will receive a UIDeviceOrientationDidChangeNotification:
>
> 12:23:01.182 -[AppDelegate iPadHasTurned:]
> and does:
> UISplitViewControllerDisplayMode newMode = PrimaryOverlay
> splitViewController.preferredDisplayMode = newMode;
> [ self performSelector: @selector(delayedSetMode:) withObject: @(newMode) afterDelay: 0 ]; // see below
>
> 12:23:01.183 -[AppDelegate splitViewController:willChangeToDisplayMode:] PrimaryOverlay
> good, that's what I just have told it to do.
>
> 12:23:01.196 -[MasterViewController viewDidAppear:]
> 12:23:01.198 -[AppDelegate iPadHasTurned:] done
>
> So far so good.
>
> But now the pesky SplitViewController decides it knows best, and does:
>
> 12:23:01.199 -[AppDelegate splitViewController:willChangeToDisplayMode:] AllVisible
>
> here my delayedSetMode will come to the rescue:
> 12:23:01.212 -[AppDelegate delayedSetMode:] displayMode → PrimaryOverlay
> does: splitViewController.preferredDisplayMode = newMode;
> 12:23:01.223 -[MasterViewController viewDidAppear:]
> 12:23:01.224 -[AppDelegate delayedSetMode:] done
>
> Is there a better way than this hack with delayedSetMode ?
Why are you doing this?
If you always want PrimaryOverlay mode, just set it once, at configuration time, and never change it again. If thats not what you want, then please explain.
>
> Gerriet.
>
>
> _______________________________________________
>
> 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
--
David Duncan
_______________________________________________
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