LaunchScreen.xib sometimes shows as black - ios

I'm using an xib for my launch screen in iOS8 and SOMETIMES instead of showing the correct launch screen (which is 3 UILabels over a UIImageView) it shows as BLACK. But not every time. This I can reproduce both on a simulator and a device.
If I remove or hide the underlying ImageView it seems work without this issue.
The image in the ImageView is a .png image 242kb.
Any thoughts? Of course I could just use an image instead of a xib if I have to, but wondering if this is a known issue or how to fix.

The launch screen is generated when the app is installed in the iOS Simulator. We could wait for that process to finish before launching the app, but we instead let that generation happen in the background. If the image hasn't finished generating by the time it is requested by the app launch, only blackness is seen.
This is a known (and accepted) race condition in the iOS Simulator. Blocking until the image finished rendering would add a small amount of delay to the launch sequence every time you clicked Build&Run. If you want to debug the launch screen, you can quit the app (remove it from app switcher) and relaunch it manually (not via build & run).
This may decision may change in the future, but for now it shaves off a little bit of time between when you click "Build & Run" and when the app finishes launching.

Related

Launch storyboards and iPhone X Safe Areas

I am updating an old app, and I would like the app to run letterbox, NOT full screen on iPhone X. That is, I want the entire app to stay within the Safe Areas and see black bars on the top and bottom. Unfortunately the app uses a Launch Storyboard, which triggers the app to run full screen. The old solution was to use a launch image instead of a launch storyboard, but as of iOS 13 Apple has deprecated launch images. What can I do? The client definitely wants a logo to appear on launch.
What you are asking to do is now illegal. Your app must use a launch storyboard and occupy the entire screen or it will be rejected at the App Store.
The client definitely wants a logo to appear on launch.
Hmmm, it sounds as if you and/or the client don't understand what a launch screen is. A launch screen is merely the outline of the actual app interface, to provide something to fill the nasty pause between the time the user taps the app icon and the time the app's interface is up and running. If the client wants a logo on launch, that would be a view (possibly belonging to a view controller) shown as part of the running app when it starts up.

LaunchScreen not loading embedded image on Xamarin.iOS

I am working on a Xamarin.iOS app. We have an issue where our LaunchScreen sometimes do not load the image we are displaying in it. The bug is very transient and it only happens sometimes to certain users.
The thing is that when the image first is loaded on a device, it always shows up. On the other hand, if the image is not shown on a device, you can restart the app several times without it being loaded. Sometimes it helps to reboot the device. Sometimes an update/reinstall fixes it, sometimes it does not.
The image resource we are loading is not included as a On-Demand bundle resource, but is included in an Asset catalog.
I have been struggling with this bug for a while now. Sometimes I think I have fixed it, but then it suddenly shows up again.
I do see my launch screen being loaded, since the background color I have on it is displayed. It is only the image I am having the issue with.
I've seen this post, but it doesn't seem to be the same issue, as what I'm experiencing is in the production build from the app store. In debug builds, the splashscreen is loaded fine every time
UIImageView missing images in Launch Screen on device
Anybody who can point into the direction I should look at? I can share some code for the xib launch screen or the asset catalog's json file if necessary.

UIImageView doesn't show up in LaunchScreen.xib

I have an image set in my asset catalog and I have it set for my UIImageView in my launch screen xib. I know the launch screen shows up because it has a label that is showing when I launch the app on my device. I can see the Image and the label in the interface builder, and even in the simulator, but when I launch the app on my device the image is not there.
Does anyone know what might be causing this, and or have any good ways to troubleshoot?
I have tried quitting xcode, doing a clean, deleting the derived data reset the simulator. I have removed and added the asset I want to show up. I removed and re-did the constraints on the launch screen. I have had no success and it is driving me a bit crazy so any help is much appreciated.
Also I have two different targets so this may be contributing to the problem, but the strange thing at one point in time I did have the uiimageview showing up on the device.
I know what causes this issue, i guess when you first installed your app on your device you did not add image to your launch screen after that you've added the image next time. Right?, iOS picking up an old launch screen so I would suggest you to uninstall your app once and re-run the app.

Xcode launch images and full screen issues

I'm testing my app on a physical device (using a provisioning profile). The device is an iPad Air 2 with iOS version 8.1.
My App wasn't appearing full screen, so I managed to get it full screen following the advice to add Default-568h#2x.png to the project, as per this thread:
Why [UIScreen mainScreen].bounds] is not returning full screen size?
However, upon adding it to images.xcassets, I see this:
Question 1) Why is Xcode complaining about a Missing Default-568h#2x.png launch image when it's clearly there?
So anyway, this made my app start full screen but the launch image was not appearing. Instead, just a plain black screen was showing up during app load.
Question 2) Why wasn't the launch image showing up?
I deleted all the launch images that were eventually added in an attempt to get something working (because this is iOS and trial and error seems to work way more than a logical process). So at the moment, no launch images exist in images.xcassets. However, my app still runs full screen. I removed the already installed app from the device (by making the icon wiggle and tapping the 'X'), selecting Product>Clean from Xcode and building again. No luck. App still appears full screen on future runs. I then attempted to follow the answer by EliSKoren on this thread:
Launch image doesn't update
However, the only reference I could find to launch images were for simulators, not physical devices.
Question 3) Trying really hard not to loose it ... What's happening!? Why is my app still appearing full screen even though I've removed launch images?
This is because Xcode provides placeholders for different devices and respective to them being retina or non retina and device sizes.
As you can see your image is on a placeholder as "unassigned", So xcode cant figure it out which device it is for, hence the image is not showing.
To correct this here is a screenshot --
EDIT
Please migrate to get the launch image assigned to the assets from here
Click on Launch Image Sources -- Use assets catalogue and the pop up will show and then click on migrate.
As you can see in the attribute inspector, you can choose which device launch image you want and it will give you that.
Check by clicking the place holder what image size or resolution it requires and then you just drag and drop those images from finder.
Hope this helps
Edit Final
As it turned out OP was using cMake for the xcode project and by default xcode had already a launch image asset JSON installed which had a wrong configuration, Thus creating another Launch Image wasnt overriding the existing JSON as for cmake the earlier config was being loaded. And by default Universal devices was selected but the Device orientation was totally unchecked.
Checking device orientation after getting a clean version of the project and letting Xcode decide its default Launch Image assets and filling up images in that JSON fixed the issue with OP. Further discussions are mentioned in the link in the comments.

Difference between launch image and splash screen

I was going through iOS Human Interface Guidelines.
It was mentioned as
Display a launch image that closely resembles the first screen of the application. This practice decrease the perceived launch time of your application.
Avoid displaying an About Window or a splash screen. In general, try to avoid providing any type of startup experience that prevents people from using your application immediately.
What is the difference between a launch image and a splash screen?
Launch image is the image that appears when you launch your app, the images you put in the xcode (iphone, iphone retina, ipad landscape, ipad landscape retina, ipad portrait and ipad portrait retina)
Apple recomends using a screenshot of your app main window, so it appears that your app launch faster (I use a screenshot without buttons)
Splass screen is, for example, the screens the games use, where you can see the company logo and some other info, some of them even use 2 or 3 splass screens. You have to include them programmatically
Wow, old question with no accepted or highly-upvoted answer, bubbling to the front page thanks to an edit. Guess I may as well try my hand at clearing things up?
Launch Image (or Launch Screen)
This is displayed by the OS itself, and appears only while the OS is loading your app (that is, before your process is running and any of your own code gets a chance to execute.
Because your app has no running code to handle display of the launch image, the way you provide one is part of your Xcode project's build-time configuration: Either you provide a LaunchScreen.storyboard, or a set of static launch images — one for each device screen size you support.
Apple's Human Interface Guidelines recommend that your launch image be a rough facsimile of the initial UI of your app. There are a couple of reasons for that:
The launch screen is displayed only briefly before your app takes over and can display its own UI, so having the launch image look like the actual UI makes the user feel more like they're jumping right into your app instead of having to wait for something else.
The launch screen is displayed only briefly, so if you display something that doesn't look like your initial UI, the user may see it flash and go away before they can get a decent look at it.
(Because your launch screen should look like actual UI, and because there are many screen sizes to support, the storyboard approach is preferred — you can use Auto Layout to ensure that your fake UI adapts to different screen sizes just like your real UI would. Xcode then generates the necessary images at build time.)
Splash Screen or About Window
This is what you see in many apps that don't follow Apple's guidance, and it comes in two forms (used separately or together):
Using the Launch Screen system to display content that doesn't look like the app's initial UI — instead, for example, it might be a logo or some other branding element, or might include static text like copyright notices, credits, or version information.
After the app has launched (and thus has control of the screen to display whatever it wants), continuing to display logos or branding or other passive content instead of a usable UI.
The second case is recommended against, but sometimes unavoidable — game engines, in particular, tend to take awhile to start up, so it might be okay to have a "loading" screen. (If so, your launch image should look like your loading screen, so that the user doesn't feel like they're separately waiting for your app to launch and then load.)
The worst offenders are apps that don't really have any extra "loading" work to do, but use a splash screen as their launch image, and then programmatically continue to display that image for an arbitrary amount of time so that the user gets more chance to see it. (And has to wait for it to get out of the way, or manually dismiss it, before actually using the app.)
Launch Image is displayed when the app loads.
Splash screen means, that you display a view with about information as your startscreen. Your User should use your app immediately.
The launch image is designed to make the perceived launch time of you app feel faster by showing something resembling the interface that will be loaded as quickly as possible. Displaying a logo does nothing but draw attention to how quickly your app loads and adds nothing to the user’s experience.
If your bundle have default.png then apps takes as a launch image and it remains on screen for 3 seconds
In iOS splash screen means when you provide any image named Default.png in the bundle and before executing the mainWindow it is just loading that image in the iPhone screen. So, Default.png image is considered as the Splash Screen in iPhone.
While you load the mainWindow in the iPhone application, you can assign any image that can be viewed in the screen in the specific size as given that is called the launch image.
So, launch image that is one which we provide run time when application launches and starting the main-window. And here launch image can be dynamically changed based on program written while Default.png / splash screen will be fixed for the application.
Please let me know if you still have any question?
Launch Image may take a little short time. It shows when app loading starts into iphone volatile memory. it shows for very short.
Splash screen means, that you display an Image until your necessary information loading not complete. Like, U can see any loading image before start any heavy game. When all data loading complete then this screen removed and game statrs.
It may shows for little long. !
Launch Image is displayed when the app loads. It is designed to make your app feel faster by showing something resembling the interface that will be loaded as quickly as possible.
Splash screen means, that you display a view with about information as your start screen. Your User should use your app immediately.

Resources