Turn off Autocorrect Globally in an App

后端 未结 4 1644
再見小時候
再見小時候 2021-01-24 12:21

I would like to disable text-entry autocorrect in an iPad application, regardless of what the global settings for autocorrect are on the device. Is there a good way to do this t

4条回答
  •  遇见更好的自我
    2021-01-24 13:11

    as @cocoakomali suggested, you can create a category of UITextField to disable autocorrect for all UITextField in the app by default

    @implementation UITextField (DisableAutoCorrect)
    
    - (instancetype)init {
      self = [super init];
      if (self) {
        [self setAutocorrectionType:UITextAutocorrectionTypeNo];
      }
      return self;
    }
    
    @end
    

提交回复
热议问题