iOS Launch screens with logic

好久不见. 提交于 2020-08-12 01:23:05

问题


Is it possible to build some logic into the iOS launch screen storyboard?

I want a 'splash' screen showing the title, only when the user launches my app for the first time.

Then in subsequent launches, I'd like the launch screen to have an empty navigation controller.

(If there's a way to do this programmatically/outside of storyboard/IB, more than happy to do this too).

Thanks


回答1:


No, not possible. The launch screen is not rendered by your app, but by the system, so it is static.

Note that the launch screen is is not a fully customizable view controller. You cannot specify a custom class name in the storyboard and expect the system to give you the option to execute code at this stage by calling viewDidLoad. Remember, the app hasn’t launched yet.

(According to this site)

Also it appears that you cannot change the launch image programatically, as discussed in this question.




回答2:


Swift 3 Version 8.3.2 (8E2002), I try add ViewController to LaunchScreen.storyboard but func viewDidLoad() not call, You can add FakeLaunchScreen.storyboard, layout the same LaunchScreen.storyboard and do something your like.



来源:https://stackoverflow.com/questions/43820589/ios-launch-screens-with-logic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!