Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sentryco/cameraview
Simple CameraView to capture QR-codes for SwiftUI
https://github.com/sentryco/cameraview
Last synced: 1 day 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 (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-17T04:29:44.000Z (about 1 month ago)
- Last Synced: 2024-10-19T06:48:58.694Z (29 days ago)
- Language: Swift
- Size: 19.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Tests](https://github.com/sentryco/CameraView/actions/workflows/Tests.yml/badge.svg)](https://github.com/sentryco/CameraView/actions/workflows/Tests.yml)
[![codebeat badge](https://codebeat.co/badges/bdc0d8ab-1d78-42a1-b92d-451cdfd0b111)](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