Using the system API (AVFoundation) for packaging, including the UI interface and QR code, barcode scanning, generating and other operations
Swift Version: ZZYQRCodeSwift
platform :ios, '8.0'
use_frameworks!
pod 'ZZYQRCode', '~> 1.1.0'
- Create sessionManager
- (instancetype)initWithAVCaptureQuality:(AVCaptureQuality)quality
AVCaptureType:(AVCaptureType)type
scanRect:(CGRect)scanRect
successBlock:(SuccessBlock)success;
- Show view
- (void)showPreviewLayerInView:(UIView *)view;
- Scan sound effects
@property(assign, nonatomic) BOOL isPlaySound;
@property(copy, nonatomic) NSString *soundName;
- Torch
- (void)turnTorch:(BOOL)state;
- Scan the QR code in the album
- (void)scanPhotoWith:(UIImage *)image successBlock:(SuccessBlock)success;
- Check authorization status
+ (void)checkAuthorizationStatusForCameraWithGrantBlock:(void(^)())grant
DeniedBlock:(void(^)())denied;
- Create QR code
UIImage *image = [UIImage createQRCodeWithSize:200 dataString:@"hello"];
- Create customize QR code
UIImage *icon = [UIImage imageNamed:@"bigMax"];
UIImage *image = [UIImage createQRCodeWithSize:200
dataString:@"hello"
QRCodeImageType:circularImage
iconImage:icon
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>