a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Using the system API (AVFoundation) for packaging, including the UI interface and QR code, barcode scanning, generating and other operations
platform :ios, '8.0'
use_frameworks!
pod 'ZZYQRCodeSwift', '~> 1.1.0'
let session = AVCaptureSessionManager(captureType: .AVCaptureTypeBoth, scanRect: CGRect.null, success: SuccessBlock)
session.showPreViewLayerIn(view: view)
var isPlaySound = false
var soundName:String?
session.turnTorch(state: torchState)
session.scanPhoto(image: UIImage, success: SuccessBlock)
class func checkAuthorizationStatusForCamera(grant:@escaping GrantBlock, denied:DeniedBlock)
let image = UIImage.createQRCode(size: 200, dataStr: "hello")
let image = UIImage(named: "bigMax")
QRImage.image = UIImage.createCustomizeQRCode(size: 200,
dataStr: "hello",
imageType: .CircularImage,
iconImage: image!,
iconImageSize: 40)
Because of iOS10 authorization change,you need to add code in your info.plist
<key>NSCameraUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>