在iOS中,如何根据环境(dev,hom,prod)更改启动屏幕图像? [英] In iOS, how to change launchscreen image according environment (dev, hom, prod)?

查看:37
本文介绍了在iOS中,如何根据环境(dev,hom,prod)更改启动屏幕图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有图像的启动屏幕,到目前为止运行良好.

但是现在我有3种模式:dev,hom和prod.

我想知道如何根据构建时选择的架构更改启动屏幕图像吗?

编辑

我有两个选择,但是我不知道哪个是最好的:

选项1:创建两个情节提要,并创建一个变量以在应用程序委托中设置正确的情节提要的名称.我将在Info.plist键(启动屏幕界面文件的基本名称)中使用此变量.

选项2:在Launchscreen.storyboard上创建两个场景,并根据环境以编程方式设置正确的场景.

解决方案

使用目标,为每个环境添加一个目标,每个目标将具有自己的info.plist,您只需为每个目标设置不同的启动屏幕故事板,设置只需在相关的info.plist中进行一次操作,您就可以选择任何目标并运行.

I have a launchscreen with a image, so far working well.

But now I have 3 schemas: dev, hom and prod.

I would to know how to change the launch screen image according the schema selected at the build time?

EDIT

I have in mind two options, but I do not know which one is best:

Option 1: Create two storyboards and create a variable to set the name of the correct storyboard in the app delegate. This variable I will use in the Info.plist key (Launch screen interface file base name).

Option 2: Create two scenes at the Launchscreen.storyboard and programatically set the correct scene according the enviroment.

解决方案

Use targets, add a target for each environment, each target will have its own info.plist and you just set a different launch screen storyboards for each target , set it once in the relevant info.plist and you ready to select any target and run.

这篇关于在iOS中,如何根据环境(dev,hom,prod)更改启动屏幕图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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