Ivan R Blog
  • Blog
  • Who
  • CTF
Sign in Subscribe

Swift

A collection of 1 post
Formatting phone numbers in Swift
Development

Formatting phone numbers in Swift

A simple code snippet to format 10 digit phone numbers in Swift 4.0, instead of including a big library, just implement a delegate function and a formatting function: * The UITextFieldDelegate function func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { var fullString = textField.text ?? "" fullString.append(
Mar 11, 2018 1 min read
Page 1 of 1
Ivan R Blog © 2023
Powered by Ghost