iOS:动态更新启动屏幕 [英] iOS: Update launch screen dynamically

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

问题描述

我使用故事板设计了一个启动画面。它应该有3张图片。其中2个是静态的,其中,我需要在运行时更新一个(从服务器下载后)。



我的理解是我们无法为启动屏幕添加代码,因为后端没有控制器。



我想要做的是第一次使用一些默认占位符。下载&在应用程序的某个其他位置缓存该动态图像。当用户第二次使用该应用时,显示缓存的图像。



任何解决方案?我可以在运行时更新 xcassets 吗?或者我可以使用 keypath 更新图像吗?



更新:
刚刚找到启动画面和启动画面有两种不同的东西(链接)。无法动态添加启动屏幕中的内容。然而,不推荐使用启动画面(没有任何需要)。

解决方案

这是不可能的,启动时使用的故事板time位于应用程序的主要包中,只读取且无法更改。



此外,您可以在启动时运行任何代码,因为您的应用程序未运行。 / p>

I've designed a launch screen using story board. It's supposed to have 3 images. 2 of these are static, where as, i need to update one at run time (after downloading that from server).

My understanding is that we can not add code for launch screen as there is no controller for this at backend.

What i want to do is to use some default place-holder for the first time. Download & cache that dynamic image at some other point in application. And when user use the app for the 2nd time, show the cached image.

Any solution? Can i update xcassets at run time? Or can i update the image using keypath?

Update: Just found that launch screen and splash screen are 2 different things (Link). Adding content in launch screen dynamically is not possible. Whereas, using splash screen (without any need) is not recommended.

解决方案

This is not possible, the story board used at launch time is in the main bundle of the application which is readonly and can not be changed.

Also you can run any code on startup, since your app is not running.

这篇关于iOS:动态更新启动屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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