Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 16 issues #47

Open
aheze opened this issue Aug 21, 2022 · 0 comments
Open

iOS 16 issues #47

aheze opened this issue Aug 21, 2022 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed iOS system bug

Comments

@aheze
Copy link
Owner

aheze commented Aug 21, 2022

There seem to be some issues with UIViewRepresentables created multiple times in iOS 16 — see https://stackoverflow.com/questions/73016607/swiftui-button-label-rendered-twice.

Not sure when this started happening, but it seems like Button labels get duplicated now. Take this code:

struct ContentView: View {
    @State var active = false
    var body: some View {
        Button {
            active.toggle()
        } label: {
            Text("Toggle")
                .onChange(of: active) { newValue in
                    print("Active changed to: \(newValue)")
                }
        }
    }
}

It renders fine Button that says Toggle, but check the console:

Active changed to: true
Active changed to: true

Why is Active changed to: true printed twice?


This affects WindowReader — the window gets stored in one of the duplicate view copies sometimes, and might not be correct until you scroll, rotate the device, or do a bounds change.

I've filed feedback FB10758896 (SwiftUI - button label rendered twice)

@aheze aheze added bug Something isn't working help wanted Extra attention is needed iOS system bug labels Aug 21, 2022
@aheze aheze pinned this issue Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed iOS system bug
Projects
None yet
Development

No branches or pull requests

1 participant