Created
June 5, 2019 13:19
-
-
Save valvoline/3c2b47339e209d20e8ebe99d53feddf1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// 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