k-arindam/swiftuicamera
**Seamless camera integration for SwiftUI.**
πΈ Features
- Easy integration with SwiftUI using
SUICameraView - Capture photos and record videos
- Access real-time camera frames as
UIImageorCIImage - Control over:
- Video quality - Shutter speed - ISO - White balance
- Simple delegate protocol for receiving media output
- Upcoming support for:
- Lens switching (wide/ultrawide/telephoto) - Zoom and focus control - Flash toggle - ProRAW capture
π Getting Started
π§ Installation
β Swift Package Manager
- Open your Xcode project.
- Navigate to File > Add Packages.
- Enter the SwiftUICamera repository URL:
`` https://github.com/k-arindam/SwiftUICamera.git ``
- Choose the latest version and add it to your app target.
π οΈ Setup
π Info.plist
To access the camera, microphone, and save media to the Photo Library, add the following entries in your app's Info.plist:
[Info.plist]
π¦ Example Usage
[ExampleApp]
π§° API Reference
π SUICameraViewModel
Create and configure a camera session:
[Configure]
πΈ Capture Photos and Videos
[Capture]
βοΈ Camera Controls
[Controls]
(Upcoming APIs: focus, zoom, lens toggle, flash, ProRAW)
π SUICameraDataDelegate
Set a delegate to receive output:
viewModel.dataDelegate = YourDelegate()Optional Methods
func photoOutput(_ photo: AVCapturePhoto, error: Error?)
func photoOutput(_ photo: UIImage?)
func finishedRecording(at url: URL, error: Error?)
func frameOutput(ciImage: CIImage)
func frameOutput(original uiImage: UIImage?)
func frameOutput(rotated uiImage: UIImage?)π Privacy
This package uses device camera and microphone. Make sure your app clearly informs users why access is required.
π¦ Legal
π¬ Feedback / Contributions
We welcome pull requests, suggestions, and issues. Letβs build the most seamless camera experience in SwiftUI!
π Links
Banner image created by Canva AI
Package Metadata
Repository: k-arindam/swiftuicamera
Default branch: main
README: README.md