This repository has been archived by the owner on Jul 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCDZQRScanningViewController.h
55 lines (44 loc) · 1.64 KB
/
CDZQRScanningViewController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// CDZQRScanningViewController.h
//
// Created by Chris Dzombak on 10/27/13.
// Copyright (c) 2013 Chris Dzombak. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void (^CDZQRScanResultBlock)(NSString *scanResult);
typedef void (^CDZQRScanErrorBlock)(NSError *error);
typedef void (^CDZQRScanCancelBlock)();
extern NSString * const CDZQRScanningErrorDomain;
typedef NS_ENUM(NSInteger, CDZQRScanningViewControllerErrorCode) {
CDZQRScanningViewControllerErrorUnavailableMetadataObjectType = 1,
};
/**
* Easy barcode scanning view controller for iOS 7.
*/
@interface CDZQRScanningViewController : UIViewController
/**
* Returns a scanning view controller configured to accept the given metadata object types.
*
* @param metadataObjectTypes An array of `AVMetadataMachineReadableCodeObject`s
*
* @return Scanning view controller configured to accept the given metadata object types
*/
- (instancetype)initWithMetadataObjectTypes:(NSArray *)metadataObjectTypes;
/**
* Returns a scanning view controller configured to accept QR codes
*
* @note This is equivalent to calling `initWithMetadataObjectTypes:@[ AVMetadataObjectTypeQRCode ]`
*
* @return Scanning view controller configured to accept QR codes
*/
- (instancetype)init;
// Your blocks will be called on the main queue.
@property (nonatomic, copy) CDZQRScanResultBlock resultBlock;
@property (nonatomic, copy) CDZQRScanErrorBlock errorBlock;
@property (nonatomic, copy) CDZQRScanCancelBlock cancelBlock;
/**
* An array of `AVMetadataMachineReadableCodeObject`s
*/
@property (nonatomic, strong, readonly) NSArray *metadataObjectTypes;
@end