Okay, I wanted to know why my preview wasn't working after updating Xcode. So I have an enum that looks like this.
enum Field {
case email
case securedPassword
case unsecuredPassword
}
Now when I add @FocusState to my TestView my preview just crashes and doesn't update. Here is how my code looks like.
struct TestView1: View {
@FocusState var focusedField: Field?
var body: some View {
Color.blue
}
}
Now when I comment out the @FocusState I am able to change the color to something like red and the preview updates. When the @FocusState is not commented out, when I change the color to something new it doesn't update the preview and gives me a weird crash.
Now is this a bug and if so is there a work around?