iosobjective-cswiftuitextview

UITextView autocapitalization is not working when keyboard is active


Currently, I am setting autocapitalization in a button target like this

//This method is fired when keyboard is still active
- (IBAction)changeAutoCapitalization:(id)sender
{   
      self.textView.autocapitalizationType = UITextAutocapitalizationTypeWords;
}

But this won't make keyboard to capital.


Solution

  • You have to call [self.textView reloadInputViews] after modifying the UITextAutocapitalizationType in order to change keyboard immediately.