LaunchScreen.xib not displaying my custom font - ios

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.

Related

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

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.

Is there a Cocoapod/Standard way that allows user to change the font size within the app like the one in iBooks app in Swift?

I am trying to implement a font size changer functionality similar to the one provided by the iBooks app in iPhone.
I know how to set the font using Dynamic Type when Text Size changes at the phone level, but the requirement here is to allow the user to change the font size within the app, and update the content as per the new font size.
(I need to change the brightness and the font size only.)
I looked over the net and found this link
This link shows a manual way of doing it. I was wondering if this a common requirement among apps and is there a standard way/cocoa pod to do this?
Thanks in advance.
Been a Java developer for about 8 years, and was used to using the term "library" which I believe didn't make much sense in the iOS world.
I was looking for something that lets me change the font size and the screen brightness in one shot since I thought it would be a common requirement in most of the reading apps. Something like this :
Since I didn't find anything, and like #WTEDST mentioned saying it requires few lines of code, I went ahead and
Added a view(B) on top of my main view(A)
Showed this view(B) only on clicking of the ᴀA button
This view(B) contained the slider component and 2 buttons at the bottom for increasing and decreasing the font size.
I added a method to change screen brightness on moving the slider and another method on each of the increase/decrease font buttons.
Used a UIStackView to arrange the items nicely.
Done.

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.

Is there a way to have a different Default.png (splash image) for different languages/locales in iOS? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Localization of Default.png is not working
My splash screen has English text in it, so I would like to be able to have a different splash image when users have a different language set.
Is this possible?
Yes, it's possible. Pretty much the same way you localize all your resources.
You just need to provide a Default.png image and then enable all the languages you're interested in. The result is that you'll get a copy of the image for each language into the respective folders. Then edit (or overwrite) each image as you need. I have tested it right now and it works fine (on iOS 5 but I believe is the same for older versions). Here is a screenshot for easy reference:
EDIT:
Regarding any doubts about whether or not this is a good practice, this is straight from Apple's documentation:
In addition to including the launch images at the top level of your
bundle, you can also include localized versions of your launch images
in your app’s language-specific project subdirectories. For more
information on localizing resources in your app, see Table 6-2.
No.
Edit: Indeed, I'm dumbfounded. Like nevan-king I'm going to leave my answer nevertheless, since I still think that's the way it is intended to be done by the iOS guidelines (and my personal opinion about localizing whole images in order to localize its text...).
A splash screen is not intended to provide information. Splash screens are only shown for like a second or so, so it would be unfeasible to show text anyway.
Common practice for what you want to do is to use your image without text as splashscreen, and after that show a custom view with your image and localized text for a few seconds.
That way it will seem like you had a localized splash screen (and the text appears shortly after the image, which is fine).
However, keep in mind that the idea of iOS apps is fast responsiveness, so only show a "startup screen" if you must (for marketing reasons or whatever).
Read this for further information: http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5
There's no way to do this. Instead, make a Default.png with no text.
Edit: I stand corrected. Just tried Alladinian's method and it worked. I'll leave my answer, as it's a useful technique to know.
You can do this pretty easily in Photoshop by selecting a square, then copying it and pasting it over the text. Use Marquee to select a square of your graphic (say an empty part of a navigation bar). Then hit "v" for the move tool. Use cmd-opt and move the square a little to the left, then cmd-opt-shift so that it doesn't move up or down. Move the square over the text and let go of the mouse button. Repeat as necessary.
If you want to see how Apple handles multi-language splash screens, open Maps or Mail. They have a Default screen with no text, then the text appears (in whatever language) when the app has loaded.

Resources