From my experience, it does popup, but not if you ask it to popup immediately at app start.... I have it popup when user get BACK to home screen and not anymore upon app launch.
It's as if there is a delay upon app start that prevents it to popup.
Anyone has clarifications on this?
Post
Replies
Boosts
Views
Activity
Indeed, definitely a bad font name. Thank you, you saved me a lot of time.
Thank you for testing.
You are right, it has to do with font as with Helvetica it works.
This is in my case in simulator iPhone 8, iOS 13.2.2
Maybe It's not the proper font label.
As i'm sure this device/os has this font. I will investigate spelling.
Sure.
VC1 is entry of app. I only need that in the stack so I can unwind later to it
VC1 only action is the performeSegue to VC2.
VC2 is the main controller of app with lots of work and variables alive.
When a user logs out of the app, I need all states to be destroyed.
I found the simplest way, instead of setting each variable to default when the user logs out, is to unwind to VC1 (so VC2 is destroyed) then VC1 immediately loads VC2, fresh, with all variables on their default values.
So the goal is to perform segue to VC2 from VC1 as fast as possible so users don't even see VC1.
That may not be the most legit way to achieve this, but the unwind makes absolutely certain that all states of VC2 die.
2 titans, and now a god :) This forum is underrated.
Thanks for your suggestions Developer Tools Engineer.
You are very right, I got myself into maintaining my own Localizable.strings file with commenting each line in there. Fortunately the project is not too big, but for the next one, I will certainly do it the right way from the start.
Answers from the titans.
Thank you for both your answers.
I went ahead with awakeFromNib().
class LevelsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
tabBarItem.title = "LevelsVC-TabBarItem".localize()
}
}
Here is an example. LevelsViewController is a view controller that is displayed when tapping a tab bar item.
The extension of string is like so:
extension String {
func localize() - String {
return NSLocalizedString(
self,
tableName: "Localizable",
bundle: .main,
value: self,
comment: self)
}
public func localize(with arguments: [CVarArg]) - String {
return String(format: self.localize(), locale: nil, arguments: arguments)
}
}
Most of my localisation is in Localizable.strings and hoped I could localize from there.
But as you said, I might as well create Main.strings files and do the localization in there for those titles. I wanted to avoid creating other files, but it really isn't a problem in the end.
I haven't created a Main.strings.
Is there anyway to translate those tab bar title without Main.strings?
viewWillAppear worked best thanks.
It appears to be because my population of the ui text was in viewDidLoad, which doesn't run each time the view controller is modally presented.
It works if I put the ui population code in viewDidAppear, but is it the best place to put it?
Thanks for the second solution.
I'm giving it a go.
I'll create the localizedStrings once for all on app initialization, then create a string extension "ToBaseLang" to handle all the rest.
Thank you very much for your answer. That seems a smart way to resolve the problem. I will test this solution over the next few days, and will not forget to come back and close the thread if all is fine
Thanks Claude31, great answer.
Good example with UIKit! Helps sink that in.