Previewing everything with SwiftUI and what are its limitations?

Last updated: 11 days ago

This talk focus on important techniques to master SwiftUI previews and using it can help improving your daily development process. In every technique, I will address the differences between previewing in static mode & play mode in canvas. What the audience will learn:

Introducing SwiftUI previews

  • SwiftUI Previews' environment variables: color themes, accessibility, ...
  • previewing localization: Text vs NSLocalizedString
  • Size class, previewing multiple device types, ...

Previewing UIKit components

  • previewing with UIViewRepresentable
  • SwiftUI environment variables with UIKit components
  • navigation bar, tab bar, table view
  • some common crashes when previewing

SwiftUI preview vs directly presenting UIViewController:

  • safe area, landscape mode or SwiftUI limitation
  • Loading content: async after, URLSession requests, WKWebView