iOS Stop uitextview from changing double straight quotes

abcdefg12345

macrumors 6502
Original poster
Jul 10, 2013
280
85
Anyone knows how to stop this annoying behaviour on uitextView it keeps changing " into “

if tries all the following and it still doesn't work, I basically want the textview to not change anything the user enters

Swift:
self.autocorrectionType = .no
self.autocapitalizationType = .none
self.spellCheckingType = .no
self.smartQuotesType = .no
self.smartDashesType = .no
self.smartInsertDeleteType = .no
 

KALLT

macrumors 601
Sep 23, 2008
4,990
3,048
Can you provide some more context? Where are you setting these variables?
 

abcdefg12345

macrumors 6502
Original poster
Jul 10, 2013
280
85
Can you provide some more context? Where are you setting these variables?
I have a function that creates the textview and other interface elements that's where im setting them on, everything works except for the double straight quotes, they keep on changing as soon as I type them in.

interestingly though if I paste them in they don't change
 

KALLT

macrumors 601
Sep 23, 2008
4,990
3,048
Like a factory method on UITextView or a subclass (because of the reference to self)? Are you using them in Interface Builder? Have you checked the debugger to confirm that the properties are indeed set?
 

TheWatchfulOne

macrumors 6502
Jun 19, 2009
406
272
I have a function that creates the textview and other interface elements that's where im setting them on, everything works except for the double straight quotes, they keep on changing as soon as I type them in.

interestingly though if I paste them in they don't change
The fancy quotes are what you get by default when you type quotes in iOS. To type the plain quotes, touch and hold the quote key and you will see a menu pop up from which you can select alternative characters including the plain quotes. Unless I've misunderstood what you are doing to get the fancy quotes?
 

abcdefg12345

macrumors 6502
Original poster
Jul 10, 2013
280
85
Like a factory method on UITextView or a subclass (because of the reference to self)? Are you using them in Interface Builder? Have you checked the debugger to confirm that the properties are indeed set?
I have tried both subclass with self and reference to textview name without subclass, I know my code is being applied to the text view because some things are working such as not capitalising first character but the quotes get replaced still.
- - Post merged: - -

The fancy quotes are what you get by default when you type quotes in iOS. To type the plain quotes, touch and hold the quote key and you will see a menu pop up from which you can select alternative characters including the plain quotes. Unless I've misunderstood what you are doing to get the fancy quotes?
It seems to be working on iOS however when I test it on macOS using catalyst it still replaces plain quotes with fancy quotes while im editing text