How to disable smart quotes on a uitextview?

iOS 11 adds smart quotes when typing. In macOS we can disable smart quotes on a NSTextView by setting:


textView.automaticQuoteSubstitutionEnabled = NO;

Neither UITextField or UITextView seem to have this property or the

enabledTextCheckingTypes property. How can smart quotes be disabled on iOS 11?

Replies

https://developer.apple.com/documentation/uikit/uitextinputtraits/2865931-smartquotestype?changes=latest_minor


textView.smartQuotesType = UITextSmartQuotesTypeNo;

Hi, I have multiple textView's in my app, so it is better way for me to disable smart quotes via appearance, but in leads to crash:

if (@available(iOS 11.0, *)) {
        [[UITextField appearance] setSmartQuotesType:UITextSmartQuotesTypeNo];
    }


Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please file a radar on UIKit with this log if you see this assertion. selectorString = setSmartQuotesType:, exercisedImplementations = { "setSmartQuotesType:" = ( ); }'


is anybody knows how to avoid this? Already sent bug report

Based on my tests and this SO post, it still happens if you copy/paste or set programmatically: https://stackoverflow.com/questions/44932863/ios-11-disable-smart-quotes