Ivan R Blog
  • Blog
  • Who
  • CTF
Subscribe
Tagged

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 ?? "

  • Ivan
Ivan Mar 11, 2018 • 1 min read
Ivan R Blog © 2022
Powered by Ghost