1

I am changing the language using

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"fr", @"en", nil] forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize];

when user taps on a button.But the user must restart the app in order for language to change. Is there anyway possible to restart or relaunch the app when user taps the button?

Signare
  • 4,175
  • 5
  • 22
  • 44
Saeed Hajizade
  • 315
  • 1
  • 4
  • 21

2 Answers2

0

Yes. There is a possibility, you can do it as Instagram iOS app. In that after changing the language in setting, they will show an alert to restart. When pressed they will force quit the app.

Note: Please check with apple guidelines before implementing it.

Arasuvel
  • 2,888
  • 1
  • 25
  • 39
0

You can go to the main storyboard after changing the language.

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc = [storyboard instantiateInitialViewController];
[UIApplication sharedApplication].delegate.window.rootViewController = vc;