Building reusable SwiftUI Components

SwiftUI makes it easy to create beautiful UIs in no time, but it is just as easy to end up with a giant view that mixes view code and business logic. Fortunately, Apple gave us some tools to keep the bloat in check and write maintainable and reusable code.

In this talk, I am going to show you how to

  • refactor an existing SwiftUI view to make it more maintainable,
  • turn it into a reusable SwiftUI component,
  • add event handling,
  • make the view configurable,
  • add it to the Xcode component library,
  • turn it into a shareable component that can be consumed via Swift Package Manager,
  • and distribute it via GitHub and the Swift Package Index


Session info:

Speaker: Peter Friese

Developer Advocate at Firebase

Date: 24 June 2022

Time: 09:50 - 10:40

Relevant tags:
Architecture Swift

See all speakers

See all videos