Member-only story

New in SwiftUI 4: Image Renderer Protocol & PDF Share File.

AnthonyDesignCode
3 min readJul 28, 2022

--

AnthonyDesignCode

Hello everyone, welcome to a new SwiftUI tutorial. I hope you are all doing well? Today I am going to show you how to use Image Renderer Protocol & PDF Share File in SwiftUI 4 and Xcode 14.

Part 2/2 👍

Let’s get started with opening up our project and getting into the ContentView.

ContentView

Next we are going to use GeometryReader for our size of the UI we are going to also use ViewThatFits!

What is a GeometryReader in SwiftUI?

This view returns a flexible preferred size to its parent layout.

What is ViewThatFits in SwiftUI?

ViewThatFits evaluates its child views in the order you provide them to the initializer. It selects the first child whose ideal size on the constrained axes fits within the proposed size. This means that you provide views in order of preference. Usually this order is largest to smallest, but since a view might fit along one constrained axis but not the other, this isn’t always the case. By default, ViewThatFits constrains in both the horizontal and vertical axes.

--

--

AnthonyDesignCode
AnthonyDesignCode

Written by AnthonyDesignCode

Hey 👋 I’m Anthony! I hope you are well?! Thank you for looking at my blog. Here you will learn how to make apps in SwiftUI for iOS 16! Thanks for reading.

Responses (1)