https://github.com/d-date/swiftbarcodereader
Capturing Barcode / QR written in Swift
https://github.com/d-date/swiftbarcodereader
swift
Last synced: 4 months ago
JSON representation
Capturing Barcode / QR written in Swift
- Host: GitHub
- URL: https://github.com/d-date/swiftbarcodereader
- Owner: d-date
- License: mit
- Created: 2016-10-02T04:42:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T02:49:41.000Z (about 9 years ago)
- Last Synced: 2025-08-24T22:05:52.437Z (10 months ago)
- Topics: swift
- Language: Swift
- Size: 29.3 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftBarcodeReader
This is a helper library for capturing barcode or QR written in Swift.
## Usage
On calling `presentBarcodeReader`, capturing View Controller will be modaled.
You can specifiy `AVMetadataObjectTypes` as enum, requirement of change camera position button and handling result/error using closure.
```swift
import SwiftBarcodeReader
func appear(){
presentBarcodeReader(scanTypes: [.EAN13Code], //you can specify code type to scan type as enum value
needChangePositionButton: true, // If you need change position button, pass `true`
success: { (type, value) in
print("type:\(type) value:\(value)")
self.resultLabel.text = "\(value)"
}) {(canceled, error) in
//cancel handle when tapped back button
if canceled {
print("canceled")
}
//error handle when occured some error
if error != nil {
print("error:\(error)")
}
}
}
```
## Requirements
* Xcode 8 and Swift 3.0
* iOS 8.0 and later
## Installation
### Cocoapod
```ruby
pod "SwiftBarcodeReader"
```
### Carthage
Prepare Cartfile, then add below.
``` ruby
github "d-date/SwiftBarcodeReader"
```
Run below on Terminal.
``` ruby
carthage update --platform-iOS
```
## Author
Daiki Matsudate([@d_date](https://twitter.com/d_date))
## Contribute
If you want to add new feature or fix bug, make an issue first and try to contact me.
## License
SwiftBarcodeReader is available under the MIT license. See the LICENSE file for more info.
## TODO
* Custermizable Capturing UI
* Show Capturing Rect