-
Notifications
You must be signed in to change notification settings - Fork 2
/
QRCodeReaderViewController.h
executable file
·94 lines (81 loc) · 3.34 KB
/
QRCodeReaderViewController.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* QRCodeReaderViewController
*
* Copyright 2014-present Yannick Loriot.
* http://yannickloriot.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import "QRCodeReaderDelegate.h"
/**
* The `QRCodeReaderViewController` is a simple QRCode Reader/Scanner based on
* the `AVFoundation` framework from Apple. It aims to replace ZXing or ZBar
* for iOS 7 and over.
*/
@interface QRCodeReaderViewController : UIViewController
#pragma mark - Managing the Delegate
/** @name Managing the Delegate */
/**
* @abstract The object that acts as the delegate of the receiving QRCode
* reader.
* @since 1.0.0
*/
@property (nonatomic, weak) id<QRCodeReaderDelegate> delegate;
#pragma mark - Creating and Inializing QRCode Readers
/** @name Creating and Inializing QRCode Readers */
/**
* @abstract Initializes a view controller to read QRCodes from a displayed
* video preview and a cancel button to be go back.
* @param cancelTitle The title of the cancel button.
* @since 1.0.0
*/
- (id)initWithCancelButtonTitle:(NSString *)cancelTitle;
/**
* @abstract Creates a view controller to read QRCodes from a displayed
* video preview and a cancel button to be go back.
* @param cancelTitle The title of the cancel button.
* @see initWithCancelButtonTitle:
* @since 1.0.0
*/
+ (instancetype)readerWithCancelButtonTitle:(NSString *)cancelTitle;
#pragma mark - Checking the Metadata Items Types
/** @name Checking the Metadata Items Types */
/**
* @abstract Returns whether you can scan a QRCode with the current device.
* @return a Boolean value indicating whether you can scan a QRCode with the current device.
*/
+ (BOOL)isAvailable;
#pragma mark - Managing the Block
/** @name Managing the Block */
/**
* @abstract Sets the completion with a block that executes when a QRCode or when the user did
* stopped the scan.
* @param completionBlock The block to be executed. This block has no return value and takes
* one argument: the `resultAsString`. If the user stop the scan and that there is no response
* the `resultAsString` argument is nil.
* @since 1.0.1
*/
- (void)setCompletionWithBlock:(void (^) (NSString *resultAsString))completionBlock;
@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com