How can I display a splash screen for longer on an iPhone?

前端 未结 24 1928
滥情空心
滥情空心 2020-11-27 11:37

How can I display a splash screen for a longer period of time than the default time on an iPhone?

24条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 12:31

    There are many options already posted here, but I ran into cocoapod today that allows you to display the contents of your LaunchScreen.xib as the initial view controller:

    https://github.com/granoff/LaunchScreen (Also see this blog post from the author with more implementation details.)

    This seems like a fairly straight-forward way to do this, and better than the vast majority of answers posted here. (Of course it wasn't possible until the introduction of LaunchScreen files in the first place.) It is possible to display an activity indicator (or anything else you want) on top of the view.

    As for why you would want to do this, I'm surprised that no one has mentioned that there are often publisher and/or partner requirements around this sort of thing. It's VERY common in games, but advertising-funded applications as well.

    Also note that this does act counter to the HIG, but then so does waiting to load any content after your application launches. Remember that the HIG are guidelines, and not requirements.

    One final note: It's my personal opinion, that any time an initial screen like this is implemented, you should be able to tap to dismiss it.

提交回复
热议问题