Skip to content

a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博

License

Notifications You must be signed in to change notification settings

zeyu1993/ZZYQRCodeSwift

Repository files navigation

ZZYQRCodeSwift

Using the system API (AVFoundation) for packaging, including the UI interface and QR code, barcode scanning, generating and other operations

Support swift4.1

Objective-C Version: ZZYQRCode

HOW to install

platform :ios, '8.0'
use_frameworks!
pod 'ZZYQRCodeSwift', '~> 1.1.0'

How to use

  1. Create sessionManager
let session = AVCaptureSessionManager(captureType: .AVCaptureTypeBoth, scanRect: CGRect.null, success: SuccessBlock)
  1. Show view
session.showPreViewLayerIn(view: view)

Others features

  1. Scan sound effects
var isPlaySound = false

var soundName:String?
  1. Torch
session.turnTorch(state: torchState)
  1. Scan the QR code in the album
session.scanPhoto(image: UIImage, success: SuccessBlock)
  1. Check authorization status
class func checkAuthorizationStatusForCamera(grant:@escaping GrantBlock, denied:DeniedBlock)
  1. Create QR code
let image = UIImage.createQRCode(size: 200, dataStr: "hello")
  1. Create customize QR code
let image = UIImage(named: "bigMax")
QRImage.image = UIImage.createCustomizeQRCode(size: 200,
                                           dataStr: "hello",
                                         imageType: .CircularImage,
                                         iconImage: image!,
                                     iconImageSize: 40)

Pay attention

Because of iOS10 authorization change,you need to add code in your info.plist

<key>NSCameraUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>

Page show

About

a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published