Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

ios - Is there any way to code the LaunchScreen programmatically

I am using Xcode7 and Swift with Storyboards. When I open the LaunchScreen.storyboard, and I try to set a Custom Class on it, Xcode complains that one cannot have a custom class on a LaunchScreen storyboard. So my question is, is there any way to programmatically code the LaunchScreen as I would like to avoid having to drag and drop elements on it using IB.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No, The launch screen is shown before your app starts executing in order to provide a transition from the Springboard to your app while it is loading.

You can either use a fixed image or you can use a simple storyboard scene using only standard, static UI elements - labels & images.

This storyboard scene is actually loaded and displayed by the OS, so it would be a security risk to allow your code to execute in that context.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...