Customisable QR Code Reader View Controller written in Swift
- iOS 8.0+
QRCodeController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'QRCodeController', '~> 0.2'
Create QRCodeController
let qrCodeController = QRCodeController()
Add callback for decoded strings
qrCodeController.callback = { result in
print(result)
}
Present it
presentViewController(qrCodeController, animated: true, completion: nil)
var borderColor: UIColor
: Sets detection border color. Default isUIColor.greenColor()
var borderWidth: CGFloat
: Sets detection border width. Default is2
var vibrate: Bool
: Vibrate on code detection. Default istrue
var closeAfterCapture: Bool
: Close controller after first capture. Default istrue
var suppotedMetadataObjectTypes: [String]
: Supported metadata object types. Default is[AVMetadataObjectTypeQRCode]
. MoreAVMetadataObjectType's
can be found onAVMetadataObject
reference.
Diego Marcon, [email protected]
QRCodeController is available under the MIT license. See the LICENSE file for more info.