Xcode 12 GM runs into infinite loop

Viewed 6299

I am developing an iOS app and it works well on Xcode 11.7, but when I run the same code in Xcode 12 and when I enter a UIPageViewController, the app runs into an infinite loop and the cpu usage shows 99%. Here is a screenshot I made after pause the app in debugger. enter image description here

It shows Application violated contract by causing UIApplicationMain() to return. This incident will be reported.

4 Answers

I have encountered similar crashes in Xcode 12. I resolved them by removing a custom loading spinner from my view, which seems to have created these problems. The loading spinner looks like this (maybe you are using similar animation code in your app?):

struct Spinner: View {
    
    @State private var isSpinning = false
    
    var body: some View {
        Circle()
            .trim(from: 1/5, to: 1)
            .stroke(style: StrokeStyle(lineWidth: 2, lineCap: .round, lineJoin: .round))
            .rotationEffect(.degrees(isSpinning ? 360 : 0))
            .animation(Animation.linear(duration: 1).repeatForever(autoreverses: false))
            .onAppear() {
                self.isSpinning = true
            }
    }
}

In my case I was instanciating a drawer controller from AppDelegate (MMDrawerController)

Any resizing of height of a view past its scrollview or putting too long text in UILabel created the issue 100% CPU, memory upping...

Issue was I was pushing a view controller instead of a nav. which usually is fine, but seems OS does not like it much

In mine case sometimes (??) happens on app simulator startup. Stopping and replay solves and don't have any alert from test teams on real devices.

Related