0

I'm getting very strange error messages with Xcode 11.5. Having device rotation support enabled, I get a bunch of error messages telling me "=== AttributeGraph: cycle detected through attribute XY ===" when the app launched in portrait mode and the screen of the simulator gets rotated. It only occurs on the simulator and just with iPhones, not iPads. Also, if I remove "navigationBarItems" the error message doesn't appear. Additionally, the content on the screen looks off (only on the Simulator, again). If I rotate again, the content is as expected.

struct ContentView: View {
    
    var body: some View {
        NavigationView {
            Text("SwiftUI")
                .navigationBarTitle("Welcome")
                .navigationBarItems(trailing:
                    Button("Help") {
                        print("Help tapped!")
                    }
            )
        }
    }
}

enter image description here

enter image description here

1 Answer 1

0

Works fine with Xcode 12 / iOS 14. As a workaround you can try to use stack navigation style for both orientations

struct ContentView: View {

    var body: some View {
        NavigationView {
            Text("SwiftUI")
                .navigationBarTitle("Welcome")
                .navigationBarItems(trailing:
                    Button("Help") {
                        print("Help tapped!")
                    }
            )
        }.navigationViewStyle(StackNavigationViewStyle())    // << here !!
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! However, even with StackNavigationStyle the issue is still present. Maybe Xcode is somehow corrupted for me?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.