/**
* 更換NavigationController 的Root
*/
public func replaceRootNavigationController(storyboardName: String, controllerType: UIViewController.Type)
{
let navigationController = self
let className = NSStringFromClass(controllerType).componentsSeparatedByString(".").last!
let storyboard = UIStoryboard(name: storyboardName, bundle: NSBundle.mainBundle())
let rootViewController = storyboard.instantiateViewControllerWithIdentifier(className)
var viewControllers = navigationController.viewControllers
viewControllers[0] = rootViewController
navigationController.setViewControllers(viewControllers, animated: false)
}
留言列表