title: UITextInputMode currentInputMode is deprecated. Suggested replacement?
body: <p>In our app, we'd like to detect the current keyboard language. For example, if the user sets up multiple language keyboards under Settings->General->Keyboard->Keyboards, we'd like to know what language they're typing in and to get a notification from NSNotificationCenter when this changes.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      NSNotificationCenter *nCenter = [NSNotificationCenter defaultCenter];
      [nCenter addObserver:self selector:@selector(languageChanged:) name:UITextInputCurrentInputModeDidChangeNotification object:nil];
      [self languageChanged:nil];
  }
  
  -(void)languageChanged:(NSNotification*)notification
  {
      for(UITextInputMode *mode in [UITextInputMode activeInputModes])
      {
          NSLog(@"Input mode: %@", mode);
          NSLog(@"Input language: %@", mode.primaryLanguage);
      }
      NSLog(@"Notification: %@", notification);
      UITextInputMode *current = [UITextInputMode currentInputMode];
      NSLog(@"Current: %@", current.primaryLanguage);
  }
  </code></pre>
  
  <p>What we've discovered with this code is that the notification fires appropriately when the user toggles keyboards using the globe icon on the keyboard, but when we iterate the UITextInputModes, they appear in the same order with no (apparent) indication of which is the current one unless we use the now-deprecated [UITextInputMode currentInputMode].</p>
  
  <p>I can't find any documentation indicating Apple's suggested alternative to this now-deprecated functionality. There are several SO threads mentioning the deprecation, but none that I found with solutions. Any ideas? Thanks in advance.</p>