Ivan's Blog
  • Blog
  • Who
  • CTF
Sign in

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 ?? "
11 Mar 2018 1 min read
Page 1 of 1
Ivan's Blog © 2025
Powered by Ghost