theomen
theomen

Reputation: 919

Reload root view controller after child view controller dismiss

I have this structure:

Root View controller -> View Controller (Language choose) Presented by modal segue.

Is it possible using delegates, to reload root view controller, to present it with new chosen language values. I use runtime language selection by localize.strings entries. The issue is that despite after language change, child languages are shown in new language, but root view is still with the old one.

Many thanks.

Upvotes: 0

Views: 1117

Answers (2)

Ariel Rodriguez
Ariel Rodriguez

Reputation: 211

Once you get the delegate or block, you have to load the localised nib, and get the strings right from it. NSLocalizedString will load the preferred language from the user defaults, and then the changes will only take effect after restarting the app. That's why you have manually load the appropriate lproj by yourself.

You can take a look at a demo app here

Upvotes: 3

Hackmodford
Hackmodford

Reputation: 3970

Yes use a delegate method or a block. When either one is triggered in the rootViewController dismiss the child view and make your changes.

Upvotes: 1

Related Questions