In this video, I’ll show you how to create a custom camera view using UIViewControllerRepresentable and SwiftUI. We’ll also explore the power of PhotosPicker for modern image selection. Whether you're new to SwiftUI or looking to level up, this tutorial is for you!
🧐 What You’ll Learn:
Build a Camera View using UIViewControllerRepresentable.
Bind image states between views for a fluid UI.
Add a PhotosPicker to integrate iOS 16's modern photo selection experience.
Clone or download the full demo project here:
📁 GitHub Repo:https://github.com/NDCSwift/SwiftUICa...
Zoom Example: https://github.com/NDCSwift/SwiftUICa...
🔥 Download My Project Files & More! 🔥
👉 Get the source code for this project & other Swift resources here:
🔗 https://ndcswift.github.io/Swift-Proj...
Subscribe for more bite-sized lessons and full tutorials on Swift, SwiftUI, and UIKit.
Links:
Xcode: https://developer.apple.com/xcode/
Swift Documentation: https://www.swift.org/documentation/
Timestamps:
0:00 Introduction
0:35 Getting User permissions (Info.plist)
2:22 Setting up the UI
3:37 Displaying the image
5:04 PhotosPicker Button
7:25 Updating the view
4:50 Accessibility Labels
10:00 Adding Camera Button
11:35 CameraView
20:48 Passing the binding
21:05 Testing on preview and simulator
21:50 testing on a real device
22:56 Displaying a placeholder
23:44 Wrap up