Cannot edit the launch screen in main storyboard - ios

I'm very new to XCode and swift. I created a launch image in the launch story board. But, I wanted a customized delay for the launch screen. So, I copy pasted the UIViewController from launch storyboard to the main storyboard and connected it to the first page of my app (which is a table) with a modal segue, created a swift file, connected the UIViewController to the corresponding class and customized the delay for the launch screen.
However the image in the launch screen is not aligned when I run the app. When I edit the picture in the main storyboard, I see no change when I run the app. I realized that I had to make the changes in the launch storyboard. Is there any way to solve this problem?

Related

Difference between view controller "use as launch screen" option and launch screen storyboard

I noticed there is a Use as Launch Screen option under File Inspector for a View Controller located in the Main.Storyboard. What is the difference between enabling the View Controller as a launch screen using this method and using the LaunchScreen.Storyboard that XCode provides? Similar questions are about the differences between Main.Storyboard and LaunchScreen.Storyboard but doesn't specifically ask about the Use as Launch Screen option.
The difference is that LaunchScreen.storyboard has this option enabled by default, but you can:
create your own separate storyboard with an initial view controller,
then select it as the launch screen for your app inside the project's settings (Project settings/General/App Icons and Launch Images/Launch Screen file),
...and it will also work in the same way.
Xcode only puts the launch screen in a different storyboard to preserve an organized view structure.

iOS Simulator AND iOS Device showing black screen after running app

I'm having a weird situation here, my simulator and my device show a black screen running the app. However, I do know that the storyboard is imported because the background music I added for the view controller is working, why is my view controller display not loading? It won't work for ANY view controller if I add one in the Storyboard file. Help?
Just made a new project copying everything to it and it works.

Modify launch screen storyboard

i've added a launch screen storyboard in my project. The storyboard contains a UIView with a UIImageView. The UIImageView shows a .png that i download from a server, and this image could be different every day.
I noticed that iOS cache the images created from the storyboard, but when i start the app with a different image, it shows the older one, and not the one i've downloaded.
The solution should be to change the storyboard to tell the OS that the splash is changed and it could generate new images.
But i don't able to tell the OS the storyboard is changed and it show always the same image.
I've tried to change the structure of the view controller adding some views.
The launch screen interface is supposed to be static, it is loaded before your code starts running. So there should be no way to dynamically change the images there.
Maybe someone will find an obscure solution for that, but my guess is that it's not possible right now.
Your project should contain a launch screen .xib file when you create it. You can simply edit the .xib to your liking. There's no need for a new/separate storyboard file.

Use LaunchScreen ViewController instead of image

I've implemented in my code LaunchScreen as view controller in storyboard and its class is : LaunchViewController also its the initial view controller in storyboard.
I set in the project settings the Launch Screen file is : Main.storyboard.
Actually i don't want to use Launch screen image, just a controller acts like Launch screen, and I'm getting the following warning in Xcode:
Applications using launch screen files and targeting iOS 7.1 and earlier need to also include a launch image in an asset catalog.
How do i solve this warning without using Images, because if i set the launch images in project settings it will automatically show empty screen, then go to my launch screen controller which doesn't make since ?
The solution was to set the Launch screen image and delete all launch images from the attribute inspector and uncheck it all.
For supporting iOS 7.1 and earlier you must to add static generated images.

iOS Launch screen code not running

I heard about the new feature which xcode 6 brings, that allows you to make a storyboard as a launchscreen.
Now..
Is there a way to control UI elements on the launchscreen story board via a viewcontroller?
(to show a loading screen or something)
I tried it, I simply did a println("Here's the view loaded on the loadingscreen") in the viewdidload on the controller which is referred to the view in the launchscreen story board, but there's no output at all..
What am I doing wrong?
You're not doing anything wrong.
No code is associated with the launch screen. You can't run any logic. It is purely there so that you can use AutoLayout to layout the launch screens for different sizes of device.
You can't specify any class to launch screen and run code there. The storyboard file is only an alternative for multiple splash screens (Launch images). You can use a single storyboard/xib file based launch screen for different iOS platforms and orientations (You can handle that using Auto Layout).
The major point that you need to remember is, at that point the application is not completely launched.
So viewDidLoad or any view life cycle methods will not be invoked.

Resources