https://github.com/sentryco/cameraview
Simple CameraView to capture QR-codes for SwiftUI
https://github.com/sentryco/cameraview
Last synced: 3 months ago
JSON representation
Simple CameraView to capture QR-codes for SwiftUI
- Host: GitHub
- URL: https://github.com/sentryco/cameraview
- Owner: sentryco
- License: mit
- Created: 2024-10-03T20:11:25.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-15T15:02:15.000Z (3 months ago)
- Last Synced: 2025-02-15T16:18:41.548Z (3 months ago)
- Language: Swift
- Size: 29.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/sentryco/CameraView/actions/workflows/Tests.yml)
[](https://codebeat.co/projects/github-com-sentryco-cameraview-main)# CameraView
Simple CameraView to capture QR-codes for SwiftUI.
## Features
- **SwiftUI Integration**: Easily integrate with SwiftUI projects.
- **QR Code Scanning**: Efficiently capture QR codes using the device's camera.
- **Customizable**: Extend and customize behaviors to fit your needs.## Requirements
- iOS 17.0+
## Installation
### Swift Package Manager
You can add `CameraView` to your project via Swift Package Manager. Add the following to your `Package.swift` file:
```swift
// swift-tools-version:5.9
import PackageDescriptionlet package = Package(
name: "YourPackageName",
products: [
// Define products here
],
dependencies: [
.package(
url: "https://github.com/sentryco/CameraView",
branch: "main"
)
],
targets: [
.target(
name: "CameraView",
dependencies: []
)
]
)
```## Usage
To use `CameraView`, import the package and then instantiate `CameraView` in your SwiftUI views:
```swift
import SwiftUI
import CameraViewstruct ContentView: View {
var body: some View {
CameraView { (_ code: String) in
print("QR code detected: \(code)")
}
}
}
```## Todo:
- Remove unit-tests
- improve Error Handling
- improve Asynchronous Operations Handling