iOS 11+ launch screen - custom named colors in dark mode - ios

Is it possible to use user defined named colors in the launch screen storyboard?
I tried creating test color in xcassets, with appearances {dark, any} and setting it as Launch screen main view background.
I noticed significant differences:
- in RELEASE my custom colors never work
- in DEBUG some colors work, some are ignored, some are changing values (e.x. dark color is correct, but light is biased), and generally it is a mess
I know I need to delete app every time since launch screen is cached, are there any additional constraints? I fail to get any consistent results. Only thing that seems to work is "System background color".
Similar question goes for images.

OK, so short update. It is possible to use named colors and images with dark appearance on the launch screen after all.
It just works like nightmare. Which means that some parts are getting somehow cached (not sure what is happening underneath).
The final result is that to get consistent results, I had not only to delete app from the device, but also restart the phone.
I also noticed, that images with dark appearance are somehow broken - twice bigger or twice smaller, than their "any" appearance counterparts (even when I used exactly same files). That altogether creates unbelievable mess making it hard to test.

This is still a mess in iOS 13. I ended up using the build in dynamic system colours and tinting them with an overlay.

Related

Magic behind views automatically adapting to ios13 dark mode?

I found it quite weird that for new projects created by xcode 11 beta, common views like UILabel, UIButton in a storyboard can automatically adapt themselves to system theme changes without any code. But for my old projects still using XIB, even though all colors are set to default, they dont change when system theme changed, i still have to manually override traitCollectionDidChange and assign them system default values in order to make them change! What am i doing wrong? thanks.
I figured out. The magic is the newly added system colors to UIColor on ios 13, for example, UIColor.systemBackgroundColor, it will be white in light mode and black in dark mode, once you assign a system color to a property, it always updates itself based on system theme. So i guess UIViews created in xcode 11 beta storyboards automatically have system colors on.

ios custom font with splash screen [duplicate]

I'm using a label to display text with my custom font on LaunchScreen.xib. My custom font shows up fine in the Interface Builder, but when I test it on my iPhone the font reverts back to the default font.
Not sure how to fix this or if it's a bug.
There's no big surprise here. The launch screen is shown at launch time - actually, before launch time - so the font probably hasn't yet loaded.
You could file a bug if you think you have a compelling use case. But I don't really think you do. Why are you showing any text in your launch image? It should be much more bare-bones than that - just enough to give the structure of the opening interface, which will be filled in when the opening interface actually appears. A "blank" screen with the same background color as the initial view controller's background color would be sufficient. You goal is just to provide an alternative to blackness.
A quick workaround is to use an UIImageView and have your text as UIImage on it, literally a picture of your text as .png / .jpeg or similar.
Note: It may take some time before you can see the image, I had to clean the Build Folder and reinstall the app a couple of times in order to see the image.
Another note: If you want to support multiple languages with different texts you will need to have different images for each language using this approach.

Launch screen - fonts not loading in simulator [duplicate]

I'm using a label to display text with my custom font on LaunchScreen.xib. My custom font shows up fine in the Interface Builder, but when I test it on my iPhone the font reverts back to the default font.
Not sure how to fix this or if it's a bug.
There's no big surprise here. The launch screen is shown at launch time - actually, before launch time - so the font probably hasn't yet loaded.
You could file a bug if you think you have a compelling use case. But I don't really think you do. Why are you showing any text in your launch image? It should be much more bare-bones than that - just enough to give the structure of the opening interface, which will be filled in when the opening interface actually appears. A "blank" screen with the same background color as the initial view controller's background color would be sufficient. You goal is just to provide an alternative to blackness.
A quick workaround is to use an UIImageView and have your text as UIImage on it, literally a picture of your text as .png / .jpeg or similar.
Note: It may take some time before you can see the image, I had to clean the Build Folder and reinstall the app a couple of times in order to see the image.
Another note: If you want to support multiple languages with different texts you will need to have different images for each language using this approach.

LaunchScreen.xib not displaying my custom font

I'm using a label to display text with my custom font on LaunchScreen.xib. My custom font shows up fine in the Interface Builder, but when I test it on my iPhone the font reverts back to the default font.
Not sure how to fix this or if it's a bug.
There's no big surprise here. The launch screen is shown at launch time - actually, before launch time - so the font probably hasn't yet loaded.
You could file a bug if you think you have a compelling use case. But I don't really think you do. Why are you showing any text in your launch image? It should be much more bare-bones than that - just enough to give the structure of the opening interface, which will be filled in when the opening interface actually appears. A "blank" screen with the same background color as the initial view controller's background color would be sufficient. You goal is just to provide an alternative to blackness.
A quick workaround is to use an UIImageView and have your text as UIImage on it, literally a picture of your text as .png / .jpeg or similar.
Note: It may take some time before you can see the image, I had to clean the Build Folder and reinstall the app a couple of times in order to see the image.
Another note: If you want to support multiple languages with different texts you will need to have different images for each language using this approach.

Launch image does not disappear upon initial app launch but does thereafter

I'm using Trigger.IO's toolkit to add the launch images. After doing so, the app fails to remove them from view after initially starting up the app. After hitting home and then going back to the app, the launch image disappears after launch.
The app isn't actually freezing after launch but just keeping the launch image at the forefront. I used a partially transparent image initially, and it appeared just to have a high z-index. I could use the app, but the launch image remained on screen over the top of everything.
As of platform version v1.4.20 you can control the launchimage visibility (http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-20).
We've seen some instances of very early usage of the Forge APIs causing the launchimage not to show. In most cases, leaving the launchimage to hide itself manually is fine; if you're having problems or want more control over the launchimage, you can use forge.launchimage.hide.
Very odd, the problem seems to have dissipated even though I have not attempted to address it directly considering it was merely a config file change.
I'll report back if the problem surfaces again, but all is well currently!
Try add to use this code line
[window setRootViewController:mainController];
For full help, we need a some your codes

Resources