How can I switch language between applications in an efficient and simple way?
My current practice is to write a Singleton
There is a way to reset the rootViewController in a single instance
This approach if the root view of the different circumstances, how to dynamically reset
For example, the root view is of type UIViewController or UITabBarController
There are several flaws in the way to reset the root view
- sometimes can not stay in the switch language page
For example, the root view is a UIViewController, and the page into the toggle language is UITabController
- if it is UITabBarController, viewControllers page, a large number of data requests, and switch the language will re-request, it is obviously very unreasonable
- Another approach is to use NotificationCenter, but this approach I think in my entire application need to register a lot of Notification is not suitable for large-scale use
I hope you can guide me about how to do the application of switching language, I can use either Objective-C or Swift
If there is a better way to tell me Thank you very much