- July 26, 2025
- Mins Read
view.addCameraBackground()
// …
view.takeCameraSnapshot( {
// animate snapshot capture
self.view.alpha = 0
UIView.animate(withDuration: 1) { self.view.alpha = 1 }
},
completion: { (capturedImage, error) -> () in
self.view.freeCameraSnapshot() // unfreeze image
// … handle capturedImage and error
}
)
// …
view.removeCameraBackground()
Important: Remember to add NSCameraUsageDescription
to your Info.plist
.
You can change the location of the camera controls (flash, timer, and front/back camera selection) or hide them altogether:
view.addCameraBackground(
showButtons: true,
buttonMargins: UIEdgeInsets(top: 30, left: 10, bottom: 10, right: 10),
buttonsLocation: .left
)
pod ‘CameraBackground’
Legacy versions:
Swift version | CameraBackground version |
---|---|
4.0 (Xcode 9.4) | pod 'MiniLayout', '~> 1.2.1' pod 'MultiToggleButton', '~> 1.7.1' pod 'CameraBackground', '~> 1.4.1' |
3 | pod 'MiniLayout', '~> 1.1.0' pod 'MultiToggleButton', '~> 1.5.2' pod 'CameraBackground', '~> 1.2' |
2.3 | pod 'MiniLayout', '~> 1.0.1' pod 'MultiToggleButton', '~> 1.4.0' pod 'CameraBackground', '~> 1.0.2' |
dependencies: [
.package(url: “https://github.com/yonat/CameraBackground”, from: “1.7.0”)
]
NavigationKit is a lightweight library which makes SwiftUI navigation super easy to use. 💻 Installation 📦 Swift Package Manager Using Swift Package Manager, add ...
An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation. NavigationStack Installation ...
With SwiftUI Router you can power your SwiftUI app with path-based routing. By utilizing a path-based system, navigation in your app becomes ...
This package takes SwiftUI's familiar and powerful NavigationStack API and gives it superpowers, allowing you to use the same API not just ...