在启动屏幕中执行代码 [英] Execute code in Launch Screen

查看:98
本文介绍了在启动屏幕中执行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode允许通过Interface Builder在 .xib 文件中创建启动画面。是否可以使用xib执行一些代码,就像在通常的视图控制器中一样?如果我们可以在应用程序启动时设置不同的文本/图像/等,那就太棒了。

Xcode allows to create launch screen in .xib files via Interface Builder. Is it possible to execute some code with the xib, just like in usual view controllers? It would be great if we can set different text/images/etc while app launching.

推荐答案

不,这是不可能的。

当启动画面是正在显示你的应用程序将处于加载状态。

When launch screen is being displayed your app will be in loading state.

甚至 - (BOOL)应用程序:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)启动屏幕显示时,launchOptions 将无法完全执行。

所以很明显,你没有任何访问你的应用程序的权限所以在这一点上你不能执行任何代码。

So it's clear that, you don't have any access to your app and so at this point you can't execute any code.

这篇关于在启动屏幕中执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆