Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created March 22, 2020 18:49
Show Gist options
  • Save vialyx/86f2ad5db7f75efb6043e48f3926df9a to your computer and use it in GitHub Desktop.
Save vialyx/86f2ad5db7f75efb6043e48f3926df9a to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
@EnvironmentObject
var viewModel: ViewModel
var body: some View {
VStack {
Spacer()
Text("Biometric Auth")
.font(.title)
Spacer()
.frame(height: 20)
Button(action: {
self.viewModel.auth()
}) {
Text("Perform Auth")
}
Spacer()
Button(action: {
self.viewModel.check()
}) {
Text("Check Domain State")
}
Spacer()
.frame(height: 20)
if viewModel.hasChanges {
Text("DomainState changed")
} else {
Text("DomainState hasn't changes")
}
Spacer()
Text("Read more on https://medium.com/@vialyx")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView().environmentObject(ViewModel())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment