Created
March 22, 2020 18:49
-
-
Save vialyx/86f2ad5db7f75efb6043e48f3926df9a to your computer and use it in GitHub Desktop.
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 | |
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