title: NSLocale NSLocale preferredLanguages is not updating on language change
body: <p>I am trying to get the current preferred language selected by the user using the following piece of code:</p>
  
  <pre><code>NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
  </code></pre>
  
  <p>This is giving me the preferred language as expected for the first time the app is run but <strong>the changes are not reflected once I change the language in the system settings.</strong> If I uninstall the app, then change the language and then again reinstall the app, the app is now working for this new language (and is only showing this language)</p>
  
  <p>Here's what is happening:</p>
  
  <blockquote>
    <ul>
    <li>The language is set to English (Australian) when the app is first installed.</li>
    <li>The app will show <code>*language</code> gives the value <code>en-AU</code> (correct value).</li>
    <li>Now the language is now changed to Serbian.</li>
    <li>After restarting the app <code>*language</code> is still giving <code>en-AU</code> whereas it should have <code>sr-XX</code>.</li>
    <li>After re-installing the app, the <code>language</code> is showing the correct value <code>sr-XX</code> and the app is working as expected but now it won't change to any other language (as described)</li>
    </ul>
  </blockquote>
  
  <p>I am testing the app directly on an iPhone (iOS 11). I have added the localization resources in the project settings and just to be sure I have also set the default application language as <em>System Preferred</em> in scheme.</p>
  
  <p>I also tried to use <code>currentLocale</code> but it is still giving the same result.</p>
  
  <p>I also found the following code somewhere, this also is giving and array 2 elements but is behaving the same as <code>preferredLanguage</code> and not changing with the language change.</p>
  
  <pre><code>NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  NSMutableArray *languages = [[NSMutableArray alloc] initWithArray:[userDefaults objectForKey:@"AppleLanguages"]];
  </code></pre>
  
  <p>I am relatively new to iOS dev and not sure where I'm doing it wrong. Please help.</p>