matteopuc / swiftui-navigation-stack

An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.
MIT License
930 stars 87 forks source link

warning emitted: CGAffineTransformInvert: singular matrix #22

Closed lingolab2 closed 4 years ago

lingolab2 commented 4 years ago

I get following warning when pushing or popping from NavigationStack

[90654:2639075] [Unknown process name] CGAffineTransformInvert: singular matrix. Am I doing something wrong here: ``` PushView(destination:SettingsView()) { VStack { Image(systemName: "gear") .resizable() .scaledToFit() .clipShape(Rectangle()) .shadow(color: .primary, radius: 5) .padding([.horizontal, .top], 7) Text("Settings").lineLimit(1) } .frame(minWidth: 50, maxWidth:100, alignment: .center) } PopView { Text("<-") } ```
matteopuc commented 4 years ago

Hi @lingolab2, sorry for the late response. I tried your code in a minimum viable example (shown below) and I didn't get any warning from xCode (with xCode v11.5):

import SwiftUI
import NavigationStack

struct Root: View {
    var body: some View {
        NavigationStackView {
            ZStack {
                Color.green.edgesIgnoringSafeArea(.all)
                PushView(destination:ChildView()) {
                    VStack {
                        Image(systemName: "gear")
                            .resizable()
                            .scaledToFit()
                            .clipShape(Rectangle())
                            .shadow(color: .primary, radius: 5)
                            .padding([.horizontal, .top], 7)
                        Text("Settings").lineLimit(1)
                    }
                    .frame(minWidth: 50, maxWidth:100, alignment: .center)
                }
            }
        }
    }
}

struct ChildView: View {
    var body: some View {
        ZStack {
            Color.yellow.edgesIgnoringSafeArea(.all)
            PopView {
                Text("<-")
            }
        }
    }
}

struct Transition_Previews: PreviewProvider {
    static var previews: some View {
        Root()
    }
}

You can copy paste my example and everything should be fine. Probably your issue doesn't strictly depend on the code you showed me. If you can show me more code (which still generates the problem) I'll try to help you. Thank you.

lingolab2 commented 4 years ago

excellent, i’ll search in my code, sorry for the trouble. please close ticket.

On 2 Jul 2020, at 19:13, Matteo notifications@github.com wrote:

Hi @lingolab2 https://github.com/lingolab2, sorry for the late response. I tried your code in a minimum viable example (shown below) and I didn't get any warning from xCode (with xCode v11.5):

import SwiftUI import NavigationStack

struct Root: View { var body: some View { NavigationStackView { ZStack { Color.green.edgesIgnoringSafeArea(.all) PushView(destination:ChildView()) { VStack { Image(systemName: "gear") .resizable() .scaledToFit() .clipShape(Rectangle()) .shadow(color: .primary, radius: 5) .padding([.horizontal, .top], 7) Text("Settings").lineLimit(1) } .frame(minWidth: 50, maxWidth:100, alignment: .center) } } } } }

struct ChildView: View { var body: some View { ZStack { Color.yellow.edgesIgnoringSafeArea(.all) PopView { Text("<-") } } } }

struct Transition_Previews: PreviewProvider { static var previews: some View { Root() } } You can copy paste my example and everything should be fine. Probably your issue doesn't strictly depend on the code you showed me. If you can show me more code (which still generates the problem) I'll try to help you. Thank you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/biobeats/swiftui-navigation-stack/issues/22#issuecomment-653013659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHBLCK5GKP2SS4YNVP5HYNTRZSFIFANCNFSM4OJGPKKA.

matteopuc commented 4 years ago

excellent, i’ll search in my code, sorry for the trouble. please close ticket.

Hi @lingolab2 take a look at #24, it might help you.