Рет қаралды 16,821
Head to 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:
seanallen.teachable.com/
Twitter:
/ seanallen_dev
Link to my book - How I Became an iOS Developer:
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:
hired.com/x/1n01g
Check out my podcast, iOS Dev Discussions:
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:
gumroad.com/a/762098803
Donny Wals - Combine:
gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843
Ray Wenderlich Books:
store.raywenderlich.com/a/208...
Links to my iOS Dev Setup & iOS Dev Book Recommendations
www.amazon.com/shop/seanallen
#swift #softwaredeveloper #iosdeveloper