This has probably changed then in iOS 8 or 9. It used to be 
splitViewControllers MUST be root and could not be presented modally, see third 
paragraph on this page:

https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/SplitViewControllers.html

"A split view controller must always be the root of any interface you create.”


Anyway, if it can be presented modally now, then, obviously, I don’t have a 
problem anymore, which is sweet!

I set the subject to SOLVED, that should flag it to others as to require no 
more attention.

Thanks again,



Diederik



> Op 9 nov. 2015, om 18:40 heeft David Duncan <david.dun...@apple.com> het 
> volgende geschreven:
> 
>> 
>> On Nov 7, 2015, at 11:31 PM, Diederik Meijer <diede...@tenhorses.com 
>> <mailto:diede...@tenhorses.com>> wrote:
>> 
>> Thank you David,
>> 
>> I forgot to mention that one of them is a UISplitViewController and - unless 
>> this has changed - that one can not be presented modally.
> 
> I’m not aware of any particular reason why a split view controller could not 
> be presented modally. Alternatively you could present the other view 
> controller with no animation and then dismiss it when you want to reveal the 
> split view controller.
> 
>> It is for this reason that I want to switch the window’s rootViewController. 
>> Otherwise, a plain presentViewController would definitely make a lot more 
>> sense :-)
>> 
>> This is what I actually found briefly after sending the question (method 
>> edited for my app’s specifics and original code found not in a separate 
>> method).
>> 
>> Method added to appDelegate:
>> 
>> -(void)switchWindowRootVCTo:(NSString *)newVCString {
>>     id newVC = nil;
>>     if ([newVCString isEqual:@"UISplitViewController"]) newVC = self.svc;
>>     else if ([newVCString isEqual:@"THWelcomeVC"]) newVC = self.wvc;
>>     self.window.rootViewController = newVC;
>>     [UIView transitionWithView:self.window 
>>              duration:0.50
>>              options:UIViewAnimationOptionTransitionCrossDissolve 
>> animations:^{ 
>>                      self.window.rootViewController = newVC; 
>>              }
>>              completion:nil];
>> }
>> 
>> So both the old and the new root VC are properties of the appDelegate 
>> (self.svc and self.wvc respectively) and they are both initialized in 
>> applicationDidiFinishLaunching.
>> 
>> Each of them can call the above method of the app delegate and trigger the 
>> switch.
>> 
>> 
>> Best regards,
>> 
>> 
>> 
>> Diederik
>> 
>> 
>> 
>>> Op 8 nov. 2015, om 04:36 heeft David Duncan <david.dun...@apple.com 
>>> <mailto:david.dun...@apple.com>> het volgende geschreven:
>>> 
>>>> 
>>>> On Nov 7, 2015, at 1:30 PM, Diederik Meijer <diede...@tenhorses.com 
>>>> <mailto:diede...@tenhorses.com>> wrote:
>>>> 
>>>> Dear list,
>>>> 
>>>> Is it possible to change an iOS app window’s rootViewController at runtime 
>>>> and have a fade animation between the two states happen?
>>> 
>>> Not trivially, but you can do this trivially by presenting your 
>>> “replacement” view controller modally, which is also the more supported 
>>> path (by far).
>>> 
>>>> 
>>>> Obviously there is no modal or push presentation, the view is just 
>>>> replaced by a new one. For this reason a fade between the two would be 
>>>> nice.
>>>> 
>>>> This is for iOS 8 and up, coding in Objective-C.
>>>> 
>>>> 
>>>> Many thanks,
>>>> 
>>>> 
>>>> 
>>>> Diederik
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 
>>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
>>>> <mailto:Cocoa-dev@lists.apple.com>)
>>>> 
>>>> Please do not post admin requests or moderator comments to the list.
>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
>>>> <http://lists.apple.com/>
>>>> 
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com 
>>>> <https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com>
>>>> 
>>>> This email sent to david.dun...@apple.com <mailto:david.dun...@apple.com>
>>> 
>>> --
>>> David Duncan
>> 
> 
> --
> David Duncan

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to