Chapter 15: SwiftUI Tips and Tricks
In the previous chapters, we tried to collect different problems, and therefore different recipes, grouping them together within a common theme. However, in this chapter, the recipes are not connected, apart from the fact that they are solutions for real-world problems.
We'll start viewing two ways of testing SwiftUI's views, using a visual technique called snapshot testing, and a more conventional one that inspects the views' hierarchy and structure.
Sometimes we must show some kind of documentation in the app, so we'll see how to present Portable Document Format (PDF) documents.
With Swift 1.0, Xcode introduced the possibility of creating coding with Playground, decreasing the feedback time from writing code to seeing its results and improving the productivity of mobile developers. We'll see a recipe on how to use SwiftUI in a Playground.
The default fonts provided by SwiftUI are pretty cool, but sometimes we...