What is the difference between launchscreen.storyboard and main.storyboard - ios

I googled the two word together but could not find anything. I have never used it. Is there any necessity for it although we have main.storyboard.

They are two completely different things. The launch screen is what first appears when the user taps the app icon before the app is finished launching. It shows a single, static screen. It can't be dynamic and it can't use any custom classes or code. It's the replacement for launch images.
The main storyboard is what your app actually displays when the app is running. It contains your app, code, and logic.

When you run your program in Xcode simulator gets open and your application gets open then you can see black white screen for fews seconds before actuals developed screen
Blank screen - LaunchScreen.storyboard - Non editable
Developed Screen - Main.storyboard - Editable for which you can able to make changes

The launchscreen.storyboard (basically a loading screen) is what comes up when the user loads the application. How long it appears to the user depends on how long it takes for the user to load your application. You can change the duration of the launchscreen.storyboard but it is not recommended, generally users want the app to load as fast as possible
The main.storyboard is appears onto the screen AFTER the launchscreen.storyboard

When the app is being running in the Simulator/iPhone the 1st screen which is loaded in the memory after the user click the app icon is LAUNCHSCREEN.STORYBOARD and after the app is fully loaded, this is the time where MAIN.STORYBOARD comes into play, this is the screen which is editable you can add actions, outlets , other screen inside a View Controller, so the main work is being done inside MAIN.STORYBOARD and LAUNCHSCREEN.STORYBOARD is being used to display something static while the app gets fully loaded.

Related

Editing the LaunchScreen.storyboard on Google Place Picker Demo

I have been trying to implement the Google Places API and stumbled upon the Place Picker Demo provided by Google. I have been trying to edit the code and tailor it to my project but to no avail. For example I tried changing the launchscreen.storyboard file to fit my needs, but in the simulator it shows up for about a second before it goes back the original app screen. So is it even possible to edit the demo code that Google has created or transfer it to my project somehow? I am also quite new to Swift and Xcode so any help would be appreciated.
This is the link to where I obtained the code from:
https://developers.google.com/places/ios-api/code-samples
The LaunchScreen.storyboard interface is only shown for a split second while the app is loading and should not contain any actual content besides a logo or a barebones preview interface (Apple discourages logos) so that the app appears to have a fast start time.
On the Human Interface Guidelines:
A launch screen appears instantly when your app starts up. The launch
screen is quickly replaced with the first screen of your app, giving
the impression that your app is fast and responsive. The launch screen
isn’t an opportunity for artistic expression. It’s solely intended to
enhance the perception of your app as quick to launch and immediately
ready for use.
If you want to have a different starting screen, add a View Controller to the Main.storyboard and set it as the Initial View Controller (a checkbox in the right sidebar).

iOS development - launch screens where image on main screen can change?

So I am new to iOS development and I have a question about the launch screen.
My app will have an image (that loads when the app opens from the internet) this can change anytime the image is updated on the website, so what is the done thing when designing a launch screen as the image could be different to what is on the launch screen?
Thanks
In Apple's Human Interface Guidelines, they suggest that the launch screen should match the first screen of your app. In the example they give, the only parts of the launch screen are the non-dynamic parts (the UI around the web content).
Design a launch screen that’s nearly identical to the first screen of your app. If you include elements that look different when the app finishes launching, people can experience an unpleasant flash between the launch screen and the first screen of the app.
The launch screen is presented before your app loads, and it should be used for static content only.
If there are any UI elements around the image that is displayed, show those in your launch screen. If not, choose a neutral background color that works well with the theme of your app.
Omit the image. A launch image should be a bare outline of what the screen will certainly contain. It might be no more than the correctly-colored background. It is just to cover the gap between nothing and something.
Read the Guidelines: https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/ Look at the picture on the left. That's a launch screen — basically empty.
LaunchScreen image is always the same..
You can set it in LaunchScreen.storyboard
The launch screen is used to display something whilst your app is initialising, making network requests or whatever.
You shouldn't be looking to load dynamic content here as if a user is on a very slow connection then they wont see anything until your image has loaded. This is why it doesn't have a view controller associated with it. it should be static.
You should only really be loading your logo or something in here, you could just use the company name. it will only show for a short amount of time. then when assets change, submit the changes to store

Custom animation in Launch Screen

I have created a new project in Xcode 7 using Swift. I noticed that the launch screen is stored in the storyboard file.
So I think if it could be customised by referring it to my CustomLauchScreenViewController. However, when I set the custom class name in LaunchScreen.storyboard, it throws an error:
Launch screens may not set custom classnames
So what is the best way to customize the LaunchScreen? I intend to use the LaunchScreen to load some data before launching the main screen.
That's not the purpose of the launch screen. What you can do however if have your first initial viewController 'act' as a launch screen. Just have it display the same image as the launch image and do what you need to do in there. Once you are done, move to your main viewController from there.
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. According to Apple interface guidelines,
A launch file (or image) provides a simple placeholder image that iOS displays when your app starts up. The placeholder image gives users the impression that your app is fast and responsive because it appears instantly and is quickly replaced by the first screen of your app.
To achieve a transition, remove the class from LaunchScreen.storyboard and set it similar to 0% loading transition. Create a new controller in your Main.storyboard and set CustomLauchScreenViewController there and assign this as initial view controller.
Set CustomLauchScreenViewController as your root view controller in your app delegate. When launch screen will be replaced by your this controller, transition is too smooth to feel any difference. After loading the data, change your root view controller to required View Controller.

Displaying iOS LaunchScreen for longer time

Some time ago we decided to put our application-loading logic into a separate function that is called after DidFinishLaunching. We are doing by showing a new UIViewController that contains the default splash image (as described here). The two reasons for this are:
We can automatically show the current version number on the splash screen.
If the loading time takes more than around 10 - 15 seconds, the app would be killed by the OS. We had this situation one time during a version update until now where a large DB / file reorganisation took up to 15 seconds. If the app would have been killed by the OS, the data would have been left in a corrupted state.
This worked fine. Now since iOS 8 things have changed a little bit and we are supposed to be using a launch screen xib or story board. I tried to load the xib in a UIViewController (our own splash screen), but this resulted in an NSInternalInconsistencyException - loaded the "" nib but the view outlet was not set. As I found out, launch screens must be pure static, same as the original launch images.
I like the concept of having only one launch screen instead of a dozen launch images. How would I be doing this? Is there a way to programmatically load the original launch screen xib and show it in my own splash screen view controller? Of course I would then also like to programmatically add the version number as I did it until now.
Edit: Putting the application to sleep in DidFinishLaunching() is not an option, see second point above.
You can't hold launch screen for longer period.
You can add a ViewController with default.png in the applicationdidFinishLoading. Show this controller for few seconds(5 secs) and replace with next view controller.
Note: According to the appstore guidelines state, you should not
delay starting of you are any longer than necessary.

Custom File for Launch Screen

I'm making an app where I need to program the launch screen, more than just placing images on the .xib file. Is there a way to connect a swift file to the launch screen so I can add animations?
I was thinking of doing something like Supercell does for Clash of Clans, where there's a loading bar and a short message users can look at while the game loads.
So is it possible to connect a swift class file to the .xib launch screen and how would one go about doing it?
Thanks
Unfortunately your app cannot process or display any animations during this launch screen. This is because the app is still technically loading.
Also it contradicts Apple's design guidelines for launch screens:
Design a plain launch image that improves the user experience. In
particular, the launch image isn’t an opportunity to provide:
An “app entry experience,” such as a splash screen
An About window
Branding elements, unless they are a static part of your app’s first
screen
What you can do is add your own custom "animation screen" as the entry point to your Storyboard (or just root view) and create animations as you normally would through a View Controller swift file.

Resources