SwiftUI Performance for Demanding Apps

SwiftUI is powerful and flexible, but sometimes confusing. Things like modifiers order, inline views, body complexity, and POD views, can all seriously affect our performance. In this talk, we will learn the best ways to write SwiftUI for resource heavy and dynamic UIs, while maintaining the golden 60fps.

In 2022, we (Adobe Bēhance) rebuilt our navigation infra, and our main Feed, in SwiftUI. We also insisted the app must run great on the worst phone we support – iPhone 6S Plus. Getting there was a journey.

We will start by comparing SwiftUI to UIKit: We know there’s no more View Controller, and views are merely “function of their state”, but what does it mean?

Next, we will dive into specific scenarios and see how this new way of thinking is critical for achieving great performance. We will learn things like:

  • Avoiding redundant view diffing
  • Controlling view update lifecycle
  • How to “hide” complex state to improve performance
  • Avoiding SwiftUI’s pitfalls, like nested publishers and iOS 14 vs 15 behavior
  • And more…