Nitish
Nitish

Reputation: 14123

iOS universal app - Blank white screen on startup

I have created a universal app and it shows a blank white screen on startup. The initial view controller does not load. I have done trying all the alternatives suggested :

  1. Set launch image source to Asset Catalog in General settings and removing launch screen file. (This shows a black screen)
  2. Set Main interface (It was already set)
  3. No missing constraint in the view.
  4. Set self.window?.makeKeyAndVisible() in didFinishLaunchingWithOptions
  5. Set the ViewController as Initial view controller in Storyboard (It was already set).

How I might get out of this trouble ?
I am adding the screenshot of my project settings just in case.

enter image description here

Here is a screenshot of my initial view controller in storyboard :

enter image description here

Upvotes: 3

Views: 3136

Answers (3)

black_pearl
black_pearl

Reputation: 2719

The images showed in launch.storyboard should locate in the project directly, or a folder in the project.

Use the image as xxx.png, then the IOS splash screen is normal.


The images showed in launch.storyboard is not seen for splash screen, when located in Assets.xcassets/xxx.imageset

Upvotes: 0

Rahul Mayani
Rahul Mayani

Reputation: 3831

Update the Launch Images in General Settings

Set the "Launch screen file" is blank.

Upvotes: 0

Nitish
Nitish

Reputation: 14123

Got the issue. Actually it is nothing wrong with what I am doing. The issue is in viewDidLoad code :

view_padding = UIView.init(frame: CGRectMake(0, 0, 25, 30))
username.leftView = view_padding
username.leftViewMode = .Always

password.leftView = view_padding
password.leftViewMode = .Always  

Not sure why but will figure it out.

Upvotes: 0

Related Questions