7

I am playing around with SwiftUI and looks pretty interesting however I am facing very annoying performance issues.

When I create a new SwiftUI file or make a large change in a SwiftUI view, XCode would start recompiling everything. It would re-compile pods(I am using Firebase) even if they are not included in the view.

This behaviour is quite painful because it takes a few minutes for the process to finish and more often than not it will result with an XCode error and I will have to click "try again" before I have anything in the Canvas or on the device.

Is there anything I can do to improve performance when developing with SwiftUI?

This is what happens when I create a brand new SwiftUI file enter image description here

mrtksn
  • 412
  • 3
  • 18

1 Answers1

3

A workaround for this issue is to create another app target that doesn't refer to any pods. This way, you can have fast compile and preview of the pure SwiftUI files as the pods and other files won't be compiled when you switch target.

mrtksn
  • 412
  • 3
  • 18