Head to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
In today's video I show you how to allow your user to select a photo from their camera roll in SwiftUI. To do this, we integrate with UIKit and the UIImagePickerController using UIViewControllerRepresentable in SwiftUI. We use the common example of creating an avatar on a basic profile screen so we will also compress the image to not have a large amount of data.
If you like my teaching or presentation style, I've started creating my own courses:
https://seanallen.teachable.com/
Twitter:
/ seanallen_dev
Link to my book - How I Became an iOS Developer:
https://gumroad.com/l/sean-allen-origin
Timestamps:
0:00 - What You'll Learn
0:45 - Why UIImage in SwiftUI?
1:12 - Profile Screen Example
1:46 - How We Implement: UIViewControllerRepresentable
2:35 - TapGesture & Sheet Code
3:25 - Create the UIViewControllerRepresentable
6:44 - Create the Coordinator
8:28 - Passing the Selected Image to SwiftUI
13:28 - Run App & Fix Common Mistakes
16:11 - You Have the Image
16:38 - Compressing the Image
Hired.com:
https://hired.com/x/1n01g
Check out my podcast, iOS Dev Discussions:
https://itunes.apple.com/us/podcast/i...
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803
Donny Wals - Combine:
https://gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843
Ray Wenderlich Books:
https://store.raywenderlich.com/a/208...
Links to my iOS Dev Setup & iOS Dev Book Recommendations
https://www.amazon.com/shop/seanallen
#swift #softwaredeveloper #iosdeveloper
Смотрите видео SwiftUI Photo Picker - Compressed Images, UIViewControllerRepresentable онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Sean Allen 29 Июль 2021. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 17,496 раз и оно понравилось 485 посетителям.