Skip to content

Instantly share code, notes, and snippets.

@valvoline
Created June 5, 2019 13:19
Show Gist options
  • Save valvoline/3c2b47339e209d20e8ebe99d53feddf1 to your computer and use it in GitHub Desktop.
Save valvoline/3c2b47339e209d20e8ebe99d53feddf1 to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// TestSwiftUI
//
// Created by valv0 on 05/06/2019.
// Copyright © 2019 Costantino Pistagna. All rights reserved.
//
import SwiftUI
struct ContentView : View {
@State var firstname:String = ""
@State var lastname:String = ""
var body: some View {
VStack(alignment: .center, spacing: 8) {
TextField($firstname, placeholder: nil, onEditingChanged: { (status) in
}) {
print("onCommit: \(self.firstname)")
}
TextField($lastname, placeholder: nil, onEditingChanged: { (status) in
}) {
print("onCommit: \(self.lastname)")
}
}
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment