Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch screens may not set custom classnames

I tried to add a custom class to my Table View Cell, but after I added it it gives the following error:

enter image description here

I often read that I can't use custom classes in the LaunchScreen but I haven't touched this file. Can anyone help me?

enter image description here

This are my general settings for the main and the launch interface.

I am using Swift.

like image 326
Genfood Avatar asked Jun 11 '16 13:06

Genfood


Video Answer


2 Answers

Go to the properties of your Main.storyboard and check that Use as Launch Screen isn't selected. It sounds like you have selected it by mistake.

enter image description here

like image 186
Paulw11 Avatar answered Oct 08 '22 16:10

Paulw11


iOS 13 note:

Prior to iOS 13, you had both:

  • Main.storyboard
  • LaunchScreen.storyboard

Starting from iOS 13 by default you have SwiftUI. As a result you no longer have the Main.storyboard. You only have LaunchScreen.storyboard.

As for their differences see here

And perhaps like me, you just saw the word storyboard and jumped right at it and later realized you're not building against Main.storyboard.

The fix is simple and is mentioned in Paulw11 answer

Why that has happened?

It's because SwiftUI has somewhat deprecated the need of storyboards and tends to put focus on using previews as a single source of truth.


If you still want to work with the storyboard then what you have to do is upon creating the project set the 'User Interface' to 'Storyboard':

enter image description here

like image 43
mfaani Avatar answered Oct 08 '22 16:10

mfaani