I have boolean variable (isTapped), once the app is launched, I'am giving it a true value, once it moves to (signupView) the app should test the value inside if statement to show some text and after that the app should change the value of (isTapped) to false!!
But it is not working!! as Type () cannot confirm to view. I tried to create a function and call it inside a view but it is not working either! Here is my code:
import SwiftUI
struct SignupView: View {
@AppStorage("isTapped") var isTapped : Bool?
var body: some View {
if (isTapped == true){
Text ("signup")
isTapped = false
}
else {
Text ("Splash")
}
}
}
.onAppearmodifier to set the variable to false is probably a good way forward