Skip to main content
deleted 2 characters in body
Source Link
Havel
  • 31
  • 3

yeah that's correct the character does not become the part of textfied.text until you return true that function

if you want to get all of character in ‘textfield shouldChangeCharacters’textfield shouldChangeCharacters try this one:

let oldText = textField.text! let r = Range(range, in: oldText) let text = oldText.replacingCharacters(in: r, with: string) 

yeah that's correct the character does not become the part of textfied.text until you return true that function

if you want to get all of character in ‘textfield shouldChangeCharacters’ try this one:

let oldText = textField.text! let r = Range(range, in: oldText) let text = oldText.replacingCharacters(in: r, with: string) 

yeah that's correct the character does not become the part of textfied.text until you return true that function

if you want to get all of character in textfield shouldChangeCharacters try this one

let oldText = textField.text! let r = Range(range, in: oldText) let text = oldText.replacingCharacters(in: r, with: string) 
Source Link
Havel
  • 31
  • 3

yeah that's correct the character does not become the part of textfied.text until you return true that function

if you want to get all of character in ‘textfield shouldChangeCharacters’ try this one:

let oldText = textField.text! let r = Range(range, in: oldText) let text = oldText.replacingCharacters(in: r, with: string)