How Do I set the rootViewController
of UINavigationController
by a method other than initWithRootViewController
?
I want use initWithNavigationBarClass:toolbarClass:
to deliver a custom toolbar for my NavigationController, so I don't think I can use initWithRootViewController
.
this one works for me, hope it helps you,
In swift 3.0 xcode8.1
in general settings delete in Main Interface: Main <-this after Main Interface:
You can solve this by calling
setViewControllers
.Like this:
Knowledge Sharing Using Swift:
Changing root view controller from class other than app delegate.swift
Hope this will helpful for someone.
Edited:
Changing rootviewcontroller With Animation can be achieve with:
We can write generalise method too similar to this.