Previewing the layout at different dynamic type sizes
Some people use small font sizes to have a higher information density, while others use large text. It is therefore important to make sure that layouts work great with all ranges of dynamic type sizes.
In this recipe, we will create an app that allows the developer to preview their designs on different dynamic type sizes.
Getting ready
Let's start by creating a SwiftUI app called DynamicTypeSizesPreview
.
How to do it…
We will create a view to display news articles. The view will contain an image, a title, and description text. We will then modify the preview to observe the view we created in different dynamic type sizes. The steps are as follows:
- Expand the Preview Content folder in the Xcode navigation pane.
- Click on Preview Assets.xcassets to view the page:
- Click Import and select the
reading.jpg
file from this recipe...