15

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.

Collin Zhang
  • 483
  • 5
  • 14

4 Answers4

0

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
            }
    }
}
raynok
  • 173
  • 7
0

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

altagir
  • 640
  • 8
  • 18
0

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.

Massimo Pavanel
  • 754
  • 8
  • 7
0

This happened to me when I forgot to add a dot before a view modifier. So check your dots, I guess.

https://developer.apple.com/forums/thread/663970

kkopec
  • 1
  • 1