When first launching the apps, I want it to show a button to log in. After successfully logged in, I want the app to show a tab bar view.. So does this mean that I need to set my app delegate to point to the UITabBarController? How can I do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I load my UITabBarController in the app delegate, so before adding the login screen the last bit of the applicationDidFinishLaunchingWithOptions looks like this:
[window addSubview:tabcontroller.view];
[window makeKeyAndVisible];
To add a view that covers the tabbar you simply insert it after the tabbarcontroller and before the makeKeyAndVisible, like this:
[window addSubview:tabcontroller.view];
[window addSubview:loginViewController.view];
[window makeKeyAndVisible];
The "loginViewController" view will appear covering everything. Once you dismiss it the tab bar will be visible and usable.