Created
November 3, 2020 21:08
-
-
Save blsage/f619dfea51f34bd4ee9a42e924354cc5 to your computer and use it in GitHub Desktop.
Jump text fields (focus and unfocus)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import iTextField | |
import iPhoneNumberField | |
struct ContentView: View { | |
@State var nameText = "" | |
@State var phoneText = "" | |
@State var phoneEditing = false | |
var body: some View { | |
VStack { | |
iTextField("Name", text: $nameText) | |
.font(UIFont(size: 24, weight: .light, design: .monospaced)) | |
.padding() | |
.onReturn { phoneEditing = true } | |
iPhoneNumberField("Phone", text: $phoneText, isEditing: $phoneEditing) | |
.font(UIFont(size: 24, weight: .light, design: .monospaced)) | |
.padding() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment