Skip to content

Instantly share code, notes, and snippets.

@blsage
Created October 20, 2020 17:45
Show Gist options
  • Save blsage/6204d3faa8dbbbe6bacce4ab389153df to your computer and use it in GitHub Desktop.
Save blsage/6204d3faa8dbbbe6bacce4ab389153df to your computer and use it in GitHub Desktop.
Quickly implement a text field designed for phone numbers. 📱🔢
import SwiftUI
import iPhoneNumberTextField
struct ContentView: View {
@State var text: String = ""
@State var isEditing: Bool = false
var body: some View {
iPhoneNumberTextField("Placeholder",
text: $text,
isEditing: $isEditing)
}
}
@blsage
Copy link
Author

blsage commented Oct 20, 2020

Phone number text field for SwiftUI

Format the user's phone number as they type it, entirely in SwiftUI 📱🔢

iPhoneNumberTextField has three required parameters: 1️⃣ a placeholder, 2️⃣ a text binding, and 3️⃣ an isEditing binding. iPhoneNumberTextField also supports a variety of modifiers.

See more here 👉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment