File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ struct ContentView: View {
1616 @AppStorage ( " origin " ) var origin = " "
1717 @AppStorage ( " devicePin " ) var devicePin = " "
1818 @State var responseJson = " "
19+ @State private var isDevicePresent = false
20+ @State private var isDevicePresentAlertShown = false
1921 var body : some View {
2022 VStack {
2123 VStack {
@@ -33,6 +35,17 @@ struct ContentView: View {
3335 }
3436 }
3537 }
38+ Button ( " Is Device Present? " ) {
39+ isDevicePresent = fido2. hasDeviceAttached ( )
40+ isDevicePresentAlertShown = true
41+ }
42+ . alert ( isPresented: $isDevicePresentAlertShown) {
43+ Alert (
44+ title: Text ( " Device is \( isDevicePresent ? " present " : " not present " ) " ) ,
45+ message: nil ,
46+ dismissButton: . default( Text ( " OK " ) )
47+ )
48+ }
3649 Button ( " Cancel " ) {
3750 fido2. cancel ( )
3851 }
You can’t perform that action at this time.
0 commit comments