Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can storyboards be used as the launch screen in tvos?

Tags:

xcode

ios

tvos

In iOS, storyboards can be used as the launch screen instead of static images. I am looking for a way to do this with tvOS as well, but I don't see the option. Is there a way to do so?

like image 521
carbocation Avatar asked Dec 08 '15 18:12

carbocation


People also ask

How do I launch storyboard in screen?

storyboard to configure your launch screen. If your project doesn't contain a default launch screen file, add a launch screen file and set the launch screen file for the target in the project editor. Choose File > New > File. Under User Interface, select Launch Screen, and click Next.

How do I make a launch screen in SwiftUI?

In SwiftUI projects, the launch screen is not generated by default. You need to add it manually in the Info. plist file. After opening the file, you should see an entry named Launch Screen.


2 Answers

Solution for tvOS 13.1 and better

Starting with tvOS 13.1 using launch images is deprecated.

The following build warning will appear:

MyApp.xcassets:1:1: Launch images are deprecated in tvOS 13.0. Use a launch storyboard or XIB instead.

You need to create a new storyboard in Xcode following this steps:

  1. From Xcode main menu choose "File" -> "New" -> "File"
  2. Change to the tvOS Tab and select "Storyboard" - name it "LaunchScreen.storyboard"
  3. Open the new file "LaunchScreen.storyboard"
  4. From Xcode main menu choose "View" -> "ShowLibrary"
  5. Enter "View Controller" in the search bar and select the "ViewController" component
  6. Done. Now you can design your launch screen in the view controllers view

  7. Now select your project file in Xcode and then select the target of yout tvOS app

  8. Make sure "General" is selected in the header
  9. Change to the section "App icons and Launch Images"
  10. In the drop down box "Launch Screen File" select ""LaunchScreen"
  11. Build and run your app
  12. Enjoy your new LaunchScreen

If your launch screen storyboard does not show up on app startup make sure that you've set the "InitalViewController" flag for the view controller in your storyboard: enter image description here

like image 102
Jochen Holzer Avatar answered Oct 10 '22 00:10

Jochen Holzer


You can now use storyboards, in fact as of tvOS 13.0 it's the preferred method.

It will automatically be set up for you on new projects. For old projects create your launch image story board, make sure "Is initial view controller" is checked in the inspector window. After setting up your storyboard under "Project Setting -> General -> Launch Screen File" you will be able to select your storyboard as the launch file to use.

like image 5
Conor Avatar answered Oct 10 '22 00:10

Conor