My expectation: I want to open a new full screen view (PhoneNumberView) on click of confirmation dialog button. Reality: Nothing happens when I click to Back button (please check my code below)
Here is my code:
SetPasswordButton(value: "exitButton",
password: $password,
key: $key,
unlocked: $unlocked,
repeatPassword: $repeatPassword, isExitButtonTapped: $isExitButtonTapped)
.confirmationDialog("", isPresented: $isExitButtonTapped) {
Button("Back", role: .destructive) {
goToPhoneScreen = true
}
.fullScreenCover(isPresented: $goToPhoneScreen {
PhoneNumberView()
}
Button("Cancel", role: .cancel) {}
}
Could you help me?
You have misplaced the
.fullScreenCover
in your code, that should be something like this, i have tested it and it's working as expected, here is the Full code,