Source: hamedulu01.medium.com

Using the New PHPicker With SwiftUI
In this article, I will walk you through how to use PHPicker in a SwiftUI app. Here’s the final code base on GitHub: These are the dependencies in this app: We will implement this app with the following steps: Let’s suppose that we will implement the functionality of picking a photo from the Photo Library and displaying it on a list. So we have a photo list in this app that looks like this: Sample app

In order to use PHPicker in SwiftUI, we need to prepare the view that conforms to the UIViewRepresentable protocol and create an instance of PHPicker inside of it. Ths step of connecting to PHPicker goes as follows: So, create ImagePicker.swift at the root folder: makeUIViewController is in charge of creating an instance of PHPicker and returning it.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners