How to change the default View Controller that is loaded when app launches?

前端 未结 4 1100
别那么骄傲
别那么骄傲 2021-01-05 16:39

I have an application, say \'MyApp\', which by default loads the view controller \'MyAppViewController\' whenever the application launches. Later, I added a new view control

4条回答
  •  再見小時候
    2021-01-05 17:06

    1. Open MainWindow.xib and replace MyAppViewController with NewViewController.
    2. In your app delegate class, replace the property for MyAppViewController with one for NewViewController. Connect NewViewController to its new outlet in Interface Builder.
    3. In application:didFinishLaunchingWithOptions: add NewViewController's view to the window instead of MyAppViewController's view.

提交回复
热议问题