Chapter 4: Viewing while Building with SwiftUI Preview

Developing an application requires several interactions between clients and developers. For example, clients may sometimes request minor changes such as colors, fonts, and image positioning. Previously, developers would need to update their designs in Xcode and recompile all the code before viewing changes. SwiftUI solves this problem by introducing canvas previews. Previews allow for live viewing of UI changes without recompiling code.

In this chapter, we will learn how to make effective use of Xcode previews to speed up the UI development time. This chapter includes the following recipes:

  • Previewing a layout in dark mode
  • Previewing a layout at different dynamic type sizes
  • Previewing a ...

Get SwiftUI Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.