改變window.rootViewController

weixin_34391445發表於2015-08-04

建立新的ViewController
NewViewController *newViewController = [[NewViewController alloc] init];

獲取應用的AppDelegate
AppDelegate *newDelegate = [[UIApplication sharedApplication] delegate];

設定rootViewController
newDelegate.window.rootViewController = newViewController;
[newDelegate.window makeKeyAndVisible];

相關文章