├── .DS_Store
├── Screenshot.png
├── V3QRCodeScanner.framework
├── Info.plist
├── V3QRCodeScanner
└── Headers
│ └── V3QRCodeReader.h
├── QRCodeReader.xcodeproj
├── xcuserdata
│ ├── bbitsdev.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── QRCodeReader.xcscheme
│ └── iosdeveloper.xcuserdatad
│ │ ├── xcschemes
│ │ └── xcschememanagement.plist
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── iosdeveloper.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── QRCodeReader
├── ViewController.h
├── AppDelegate.h
├── main.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── AppDelegate.m
└── ViewController.m
├── ios.svg
├── objective_c.svg
└── README.md
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VivekVithlani/QRCodeReader/HEAD/.DS_Store
--------------------------------------------------------------------------------
/Screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VivekVithlani/QRCodeReader/HEAD/Screenshot.png
--------------------------------------------------------------------------------
/V3QRCodeScanner.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VivekVithlani/QRCodeReader/HEAD/V3QRCodeScanner.framework/Info.plist
--------------------------------------------------------------------------------
/V3QRCodeScanner.framework/V3QRCodeScanner:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VivekVithlani/QRCodeReader/HEAD/V3QRCodeScanner.framework/V3QRCodeScanner
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/xcuserdata/bbitsdev.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/project.xcworkspace/xcuserdata/iosdeveloper.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VivekVithlani/QRCodeReader/HEAD/QRCodeReader.xcodeproj/project.xcworkspace/xcuserdata/iosdeveloper.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/QRCodeReader/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // QRCodeReader
4 | //
5 | // Created by BBITSDev on 7/13/16.
6 | // Copyright © 2016 BBITSDev. All rights reserved.
7 | //
8 |
9 | #import
10 | @interface ViewController : UIViewController {
11 | }
12 | @end
13 |
14 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/QRCodeReader/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // QRCodeReader
4 | //
5 | // Created by BBITSDev on 7/13/16.
6 | // Copyright © 2016 BBITSDev. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/QRCodeReader/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // QRCodeReader
4 | //
5 | // Created by BBITSDev on 7/13/16.
6 | // Copyright © 2016 BBITSDev. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/xcuserdata/iosdeveloper.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | QRCodeReader.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/xcuserdata/bbitsdev.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | QRCodeReader.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 06F837B11D3671740092CEDF
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/QRCodeReader/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ios.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/objective_c.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/V3QRCodeScanner.framework/Headers/V3QRCodeReader.h:
--------------------------------------------------------------------------------
1 | //
2 | // V3QRCodeReader.h
3 | //
4 | // Created by Vivek Vithlani on 7/27/15.
5 | // Modify by Vivek Vithalain on 21-Nov-2018
6 | // Copyright (c) 2015 iOS Developer. All rights reserved.
7 | //
8 | // Supported BarCodeType
9 | /*
10 | PDF417
11 | QRCode
12 | UPCECode
13 | 39Code
14 | Code39Mod43Code
15 | EAN13Code
16 | EAN8Code
17 | Code93Code
18 | Code128Code
19 | AztecCode
20 | Interleaved2of5Code
21 | ITF14Code
22 | DataMatrixCode
23 | */
24 |
25 | #import
26 |
27 | @protocol V3QRCodeReaderDelegate
28 | @required
29 | - (void)getBarCodeData:(NSDictionary *)scanDictonary;
30 |
31 | @optional
32 | - (void)getQRCodeData:(id)qRCodeData __attribute__((deprecated("please use getBarCodeData instead")));
33 | @end
34 |
35 | @interface V3QRCodeReader : UIView
36 | // V3QRCodeReader Delegate
37 | @property (nonatomic, retain) id delegate;
38 |
39 | // init view
40 | -(id)initWithFrame:(CGRect)frame viewController:(id)ViewController;
41 |
42 | // Start Barcode reading
43 | -(BOOL)startReading;
44 |
45 | // Stop Barcode reading
46 | -(void)stopReading;
47 |
48 | // Check Barcode scanning status
49 | -(BOOL)isRunning;
50 | @end
51 |
--------------------------------------------------------------------------------
/QRCodeReader/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | V3BarCodeReader
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSCameraUsageDescription
28 | $(PRODUCT_NAME) camera use
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UIRequiredDeviceCapabilities
34 |
35 | armv7
36 |
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationPortrait
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/xcuserdata/iosdeveloper.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/QRCodeReader/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/QRCodeReader/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // QRCodeReader
4 | //
5 | // Created by BBITSDev on 7/13/16.
6 | // Copyright © 2016 BBITSDev. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 | - (void)applicationWillResignActive:(UIApplication *)application {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application {
29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31 | }
32 |
33 | - (void)applicationWillEnterForeground:(UIApplication *)application {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application {
42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/QRCodeReader/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # V3QRCodeReader
2 |
3 | [](https://github.com/VivekVithlani/QRCodeReader)
4 | 
5 |
6 | ===========
7 | ## Description
8 |
9 | **V3QRCodeReader** is a simple and beautiful wrapper around the camera with
10 | barcode capturing functionality and a great user experience.
11 | - [x] Barcode scanning.
12 | - [x] Tap to focus.
13 | - [x] No external dependencies.
14 |
15 | ## Screenshot
16 | [](https://youtu.be/HEnNMDQ58HU)
17 |
18 | ## How to use
19 | ##### 1. Embeded Binaries
20 | https://youtu.be/A7KhnHdOs6A
21 |
22 | ##### 2. Drag and drop UIView in your view controller.
23 | ##### 3. Change Class of UIVIew.
24 | ##### 4. Bind your UIView.
25 | https://youtu.be/_iWtz7nWIaM
26 |
27 | ##### 5. Camera Permission.
28 | ##### Key: `Privacy - Camera Usage Description`
29 | ##### Value : `$(PRODUCT_NAME) camera use`
30 |
31 | for more details please visit : https://ioshelloworld.blogspot.com/2016/10/ios-10-infoplist-changes-required.html
32 |
33 |
34 |
35 | #### *Paste "M1, M2" methods in your view controller* (i.e. "ViewController.m")
36 |
37 | #### "M1" *viewDidLoad, viewWillAppear, viewWillDisappear*
38 | ```objective-c
39 | - (void)viewDidLoad {
40 | [super viewDidLoad];
41 | // Do any additional setup after loading the view, typically from a nib.
42 | [qrCodeView setDelegate:self];
43 | }
44 |
45 | - (void)viewWillAppear:(BOOL)animated {
46 | if (!qrCodeView.isRunning) {
47 | [qrCodeView startReading];
48 | }
49 | }
50 |
51 | -(void)viewWillDisappear:(BOOL)animated {
52 | // stop reading
53 | [qrCodeView stopReading];
54 | }
55 | ```
56 |
57 | ##### And here the delegate methods:
58 | ### "M2" V3QRCodeReaderDelegate
59 | ```objective-c
60 | #pragma mark - V3QRCodeReaderDelegate
61 | - (void)getBarCodeData:(NSDictionary *)scanDictonary {
62 | NSLog(@"scanDictonary : %@",scanDictonary);
63 |
64 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[scanDictonary valueForKey:@"barCodeType"] message:[scanDictonary valueForKey:@"barCodeValue"] preferredStyle:UIAlertControllerStyleAlert];
65 | UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil];
66 | [alertController addAction:cancel];
67 |
68 | // Get Screenshot of Barcode
69 | if ([scanDictonary valueForKey:@"image"]) {
70 | /* scan image
71 | UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
72 | */
73 | }
74 |
75 | UIAlertAction *reScan = [UIAlertAction actionWithTitle:@"Rescan" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
76 | [self reScanBarCode];
77 | }];
78 |
79 | [alertController addAction:reScan];
80 | [self presentViewController:alertController animated:YES completion:nil];
81 | }
82 | ```
83 | ##### Tap to focus feture added.
84 |
85 | ## Supported BarCodeType
86 | - [x] PDF417
87 | - [x] QRCode
88 | - [x] UPCECode
89 | - [x] 39Code
90 | - [x] Code39Mod43Code
91 | - [x] EAN13Code
92 | - [x] EAN8Code
93 | - [x] Code93Code
94 | - [x] Code128Code
95 | - [x] AztecCode
96 | - [x] Interleaved2of5Code
97 | - [x] ITF14Code
98 | - [x] DataMatrixCode
99 |
100 |
101 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/xcuserdata/bbitsdev.xcuserdatad/xcschemes/QRCodeReader.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/QRCodeReader/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // QRCodeReader
4 | //
5 | // Created by BBITSDev on 7/13/16.
6 | // Copyright © 2016 BBITSDev. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import
11 | #import
12 |
13 |
14 | @interface ViewController () {
15 | // QRCodeView ---------------------------------------------------------
16 | IBOutlet V3QRCodeReader *qrCodeView;
17 | // QRCodeView ---------------------------------------------------------
18 | }
19 |
20 | @end
21 |
22 | @implementation ViewController
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | // Do any additional setup after loading the view, typically from a nib.
26 | [qrCodeView setDelegate:self];
27 | }
28 |
29 | - (void)viewWillAppear:(BOOL)animated {
30 | [self checkCameraPermission];
31 | }
32 |
33 | -(void)viewWillDisappear:(BOOL)animated {
34 | // stop reading
35 | [qrCodeView stopReading];
36 | }
37 |
38 | #pragma mark - Check Camera Permission
39 | - (void) checkCameraPermission {
40 | AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
41 | if(authStatus == AVAuthorizationStatusAuthorized) {
42 | if (!qrCodeView.isRunning) {
43 | [qrCodeView startReading];
44 | }
45 | }
46 | else if(authStatus == AVAuthorizationStatusNotDetermined) {
47 | NSLog(@"%@", @"Camera access not determined. Ask for permission.");
48 |
49 | [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
50 | if(granted) {
51 | NSLog(@"Granted access to %@", AVMediaTypeVideo);
52 | if (!qrCodeView.isRunning) {
53 | [qrCodeView startReading];
54 | }
55 | }
56 | else {
57 | NSLog(@"Not granted access to %@", AVMediaTypeVideo);
58 | [self camDenied];
59 | }
60 | }];
61 | }
62 | else if (authStatus == AVAuthorizationStatusRestricted) {
63 | // My own Helper class is used here to pop a dialog in one simple line.
64 | [self showAlertTitle:@"Error" withMessage:@"You've been restricted from using the camera on this device. Without camera access this feature won't work. Please contact the device owner so they can give you access." onView:self andCompletionHandler:nil];
65 | }
66 | else {
67 | [self camDenied];
68 | }
69 | }
70 |
71 | - (void)camDenied {
72 | NSLog(@"%@", @"Denied camera access");
73 |
74 | NSString *alertText;
75 | NSString *alertButton;
76 |
77 | BOOL canOpenSettings = (&UIApplicationOpenSettingsURLString != NULL);
78 | if (canOpenSettings)
79 | {
80 | alertText = @"It looks like your privacy settings are preventing us from accessing your camera to do barcode scanning. You can fix this by doing the following:\n\n1. Touch the Go button below to open the Settings app.\n\n2. Turn the Camera on.\n\n3. Open this app and try again.";
81 |
82 | alertButton = @"Go";
83 | }
84 | else
85 | {
86 | alertText = @"It looks like your privacy settings are preventing us from accessing your camera to do barcode scanning. You can fix this by doing the following:\n\n1. Close this app.\n\n2. Open the Settings app.\n\n3. Scroll to the bottom and select this app in the list.\n\n4. Turn the Camera on.\n\n5. Open this app and try again.";
87 |
88 | alertButton = @"OK";
89 | }
90 |
91 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error" message:alertText preferredStyle:UIAlertControllerStyleAlert];
92 | UIAlertAction *cancel = [UIAlertAction actionWithTitle:alertButton style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
93 | // Open Setting
94 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
95 | }];
96 |
97 | [alertController addAction:cancel];
98 |
99 | [self presentViewController:alertController animated:true completion:nil];
100 | }
101 |
102 | #pragma mark - V3QRCodeReaderDelegate
103 | - (void)getBarCodeData:(NSDictionary *)scanDictonary {
104 | NSLog(@"scanDictonary : %@",scanDictonary);
105 |
106 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[scanDictonary valueForKey:@"barCodeType"] message:[scanDictonary valueForKey:@"barCodeValue"] preferredStyle:UIAlertControllerStyleAlert];
107 | UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil];
108 | [alertController addAction:cancel];
109 |
110 | // Get Screenshot of Barcode
111 | if ([scanDictonary valueForKey:@"image"]) {
112 | /* scan image
113 | UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
114 | */
115 | }
116 |
117 | UIAlertAction *reScan = [UIAlertAction actionWithTitle:@"Rescan" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
118 | [self reScanBarCode];
119 | }];
120 |
121 | [alertController addAction:reScan];
122 | [self presentViewController:alertController animated:YES completion:nil];
123 | }
124 |
125 | -(void)reScanBarCode {
126 | [qrCodeView startReading];
127 | }
128 |
129 | -(void)showAlertTitle:(NSString *)title withMessage:(NSString *)message onView:(UIViewController *)viewController andCompletionHandler:(void (^)(UIAlertAction *action)) completionHandler
130 | {
131 | UIAlertController * alert= [UIAlertController
132 | alertControllerWithTitle:title
133 | message:message
134 | preferredStyle:UIAlertControllerStyleAlert];
135 |
136 | UIAlertAction* okButton = [UIAlertAction
137 | actionWithTitle:@"OK"
138 | style:UIAlertActionStyleDefault
139 | handler:^(UIAlertAction * action)
140 | {
141 | //Handel your yes please button action here
142 | [alert dismissViewControllerAnimated:YES completion:nil];
143 | completionHandler(action);
144 | }];
145 |
146 | [alert addAction:okButton];
147 | dispatch_async(dispatch_get_main_queue(), ^{
148 | [viewController presentViewController:alert animated:YES completion:nil];
149 | });
150 | }
151 |
152 |
153 | - (void)didReceiveMemoryWarning {
154 | [super didReceiveMemoryWarning];
155 | // Dispose of any resources that can be recreated.
156 | }
157 |
158 | @end
159 |
--------------------------------------------------------------------------------
/QRCodeReader.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 06F837B71D3671750092CEDF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 06F837B61D3671750092CEDF /* main.m */; };
11 | 06F837BA1D3671750092CEDF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 06F837B91D3671750092CEDF /* AppDelegate.m */; };
12 | 06F837BD1D3671750092CEDF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 06F837BC1D3671750092CEDF /* ViewController.m */; };
13 | 06F837C01D3671750092CEDF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 06F837BE1D3671750092CEDF /* Main.storyboard */; };
14 | 06F837C21D3671750092CEDF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 06F837C11D3671750092CEDF /* Assets.xcassets */; };
15 | 06F837C51D3671750092CEDF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 06F837C31D3671750092CEDF /* LaunchScreen.storyboard */; };
16 | 445AB3EC21AFFCB20040B04F /* V3QRCodeScanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 445AB3EA21AFFCAB0040B04F /* V3QRCodeScanner.framework */; };
17 | 445AB3ED21AFFCB20040B04F /* V3QRCodeScanner.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 445AB3EA21AFFCAB0040B04F /* V3QRCodeScanner.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXCopyFilesBuildPhase section */
21 | 06F837D31D3672B10092CEDF /* Embed Frameworks */ = {
22 | isa = PBXCopyFilesBuildPhase;
23 | buildActionMask = 2147483647;
24 | dstPath = "";
25 | dstSubfolderSpec = 10;
26 | files = (
27 | 445AB3ED21AFFCB20040B04F /* V3QRCodeScanner.framework in Embed Frameworks */,
28 | );
29 | name = "Embed Frameworks";
30 | runOnlyForDeploymentPostprocessing = 0;
31 | };
32 | /* End PBXCopyFilesBuildPhase section */
33 |
34 | /* Begin PBXFileReference section */
35 | 06F837B21D3671740092CEDF /* QRCodeReader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QRCodeReader.app; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 06F837B61D3671750092CEDF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
37 | 06F837B81D3671750092CEDF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
38 | 06F837B91D3671750092CEDF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
39 | 06F837BB1D3671750092CEDF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
40 | 06F837BC1D3671750092CEDF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
41 | 06F837BF1D3671750092CEDF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 06F837C11D3671750092CEDF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 06F837C41D3671750092CEDF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 06F837C61D3671750092CEDF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 445AB3EA21AFFCAB0040B04F /* V3QRCodeScanner.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = V3QRCodeScanner.framework; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 06F837AF1D3671740092CEDF /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | 445AB3EC21AFFCB20040B04F /* V3QRCodeScanner.framework in Frameworks */,
54 | );
55 | runOnlyForDeploymentPostprocessing = 0;
56 | };
57 | /* End PBXFrameworksBuildPhase section */
58 |
59 | /* Begin PBXGroup section */
60 | 06F837A91D3671740092CEDF = {
61 | isa = PBXGroup;
62 | children = (
63 | 445AB3EA21AFFCAB0040B04F /* V3QRCodeScanner.framework */,
64 | 06F837B41D3671750092CEDF /* QRCodeReader */,
65 | 06F837B31D3671740092CEDF /* Products */,
66 | );
67 | sourceTree = "";
68 | };
69 | 06F837B31D3671740092CEDF /* Products */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 06F837B21D3671740092CEDF /* QRCodeReader.app */,
73 | );
74 | name = Products;
75 | sourceTree = "";
76 | };
77 | 06F837B41D3671750092CEDF /* QRCodeReader */ = {
78 | isa = PBXGroup;
79 | children = (
80 | 06F837B81D3671750092CEDF /* AppDelegate.h */,
81 | 06F837B91D3671750092CEDF /* AppDelegate.m */,
82 | 06F837BB1D3671750092CEDF /* ViewController.h */,
83 | 06F837BC1D3671750092CEDF /* ViewController.m */,
84 | 06F837BE1D3671750092CEDF /* Main.storyboard */,
85 | 06F837C11D3671750092CEDF /* Assets.xcassets */,
86 | 06F837C31D3671750092CEDF /* LaunchScreen.storyboard */,
87 | 06F837C61D3671750092CEDF /* Info.plist */,
88 | 06F837B51D3671750092CEDF /* Supporting Files */,
89 | );
90 | path = QRCodeReader;
91 | sourceTree = "";
92 | };
93 | 06F837B51D3671750092CEDF /* Supporting Files */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 06F837B61D3671750092CEDF /* main.m */,
97 | );
98 | name = "Supporting Files";
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 06F837B11D3671740092CEDF /* QRCodeReader */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 06F837C91D3671750092CEDF /* Build configuration list for PBXNativeTarget "QRCodeReader" */;
107 | buildPhases = (
108 | 06F837AE1D3671740092CEDF /* Sources */,
109 | 06F837AF1D3671740092CEDF /* Frameworks */,
110 | 06F837B01D3671740092CEDF /* Resources */,
111 | 06F837D31D3672B10092CEDF /* Embed Frameworks */,
112 | );
113 | buildRules = (
114 | );
115 | dependencies = (
116 | );
117 | name = QRCodeReader;
118 | productName = QRCodeReader;
119 | productReference = 06F837B21D3671740092CEDF /* QRCodeReader.app */;
120 | productType = "com.apple.product-type.application";
121 | };
122 | /* End PBXNativeTarget section */
123 |
124 | /* Begin PBXProject section */
125 | 06F837AA1D3671740092CEDF /* Project object */ = {
126 | isa = PBXProject;
127 | attributes = {
128 | LastUpgradeCheck = 0730;
129 | ORGANIZATIONNAME = BBITSDev;
130 | TargetAttributes = {
131 | 06F837B11D3671740092CEDF = {
132 | CreatedOnToolsVersion = 7.3;
133 | DevelopmentTeam = F4PC9X3XW8;
134 | };
135 | };
136 | };
137 | buildConfigurationList = 06F837AD1D3671740092CEDF /* Build configuration list for PBXProject "QRCodeReader" */;
138 | compatibilityVersion = "Xcode 3.2";
139 | developmentRegion = English;
140 | hasScannedForEncodings = 0;
141 | knownRegions = (
142 | en,
143 | Base,
144 | );
145 | mainGroup = 06F837A91D3671740092CEDF;
146 | productRefGroup = 06F837B31D3671740092CEDF /* Products */;
147 | projectDirPath = "";
148 | projectRoot = "";
149 | targets = (
150 | 06F837B11D3671740092CEDF /* QRCodeReader */,
151 | );
152 | };
153 | /* End PBXProject section */
154 |
155 | /* Begin PBXResourcesBuildPhase section */
156 | 06F837B01D3671740092CEDF /* Resources */ = {
157 | isa = PBXResourcesBuildPhase;
158 | buildActionMask = 2147483647;
159 | files = (
160 | 06F837C51D3671750092CEDF /* LaunchScreen.storyboard in Resources */,
161 | 06F837C21D3671750092CEDF /* Assets.xcassets in Resources */,
162 | 06F837C01D3671750092CEDF /* Main.storyboard in Resources */,
163 | );
164 | runOnlyForDeploymentPostprocessing = 0;
165 | };
166 | /* End PBXResourcesBuildPhase section */
167 |
168 | /* Begin PBXSourcesBuildPhase section */
169 | 06F837AE1D3671740092CEDF /* Sources */ = {
170 | isa = PBXSourcesBuildPhase;
171 | buildActionMask = 2147483647;
172 | files = (
173 | 06F837BD1D3671750092CEDF /* ViewController.m in Sources */,
174 | 06F837BA1D3671750092CEDF /* AppDelegate.m in Sources */,
175 | 06F837B71D3671750092CEDF /* main.m in Sources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXSourcesBuildPhase section */
180 |
181 | /* Begin PBXVariantGroup section */
182 | 06F837BE1D3671750092CEDF /* Main.storyboard */ = {
183 | isa = PBXVariantGroup;
184 | children = (
185 | 06F837BF1D3671750092CEDF /* Base */,
186 | );
187 | name = Main.storyboard;
188 | sourceTree = "";
189 | };
190 | 06F837C31D3671750092CEDF /* LaunchScreen.storyboard */ = {
191 | isa = PBXVariantGroup;
192 | children = (
193 | 06F837C41D3671750092CEDF /* Base */,
194 | );
195 | name = LaunchScreen.storyboard;
196 | sourceTree = "";
197 | };
198 | /* End PBXVariantGroup section */
199 |
200 | /* Begin XCBuildConfiguration section */
201 | 06F837C71D3671750092CEDF /* Debug */ = {
202 | isa = XCBuildConfiguration;
203 | buildSettings = {
204 | ALWAYS_SEARCH_USER_PATHS = NO;
205 | CLANG_ANALYZER_NONNULL = YES;
206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
207 | CLANG_CXX_LIBRARY = "libc++";
208 | CLANG_ENABLE_MODULES = YES;
209 | CLANG_ENABLE_OBJC_ARC = YES;
210 | CLANG_WARN_BOOL_CONVERSION = YES;
211 | CLANG_WARN_CONSTANT_CONVERSION = YES;
212 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
213 | CLANG_WARN_EMPTY_BODY = YES;
214 | CLANG_WARN_ENUM_CONVERSION = YES;
215 | CLANG_WARN_INT_CONVERSION = YES;
216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
217 | CLANG_WARN_UNREACHABLE_CODE = YES;
218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
220 | COPY_PHASE_STRIP = NO;
221 | DEBUG_INFORMATION_FORMAT = dwarf;
222 | ENABLE_STRICT_OBJC_MSGSEND = YES;
223 | ENABLE_TESTABILITY = YES;
224 | GCC_C_LANGUAGE_STANDARD = gnu99;
225 | GCC_DYNAMIC_NO_PIC = NO;
226 | GCC_NO_COMMON_BLOCKS = YES;
227 | GCC_OPTIMIZATION_LEVEL = 0;
228 | GCC_PREPROCESSOR_DEFINITIONS = (
229 | "DEBUG=1",
230 | "$(inherited)",
231 | );
232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
234 | GCC_WARN_UNDECLARED_SELECTOR = YES;
235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
236 | GCC_WARN_UNUSED_FUNCTION = YES;
237 | GCC_WARN_UNUSED_VARIABLE = YES;
238 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
239 | MTL_ENABLE_DEBUG_INFO = YES;
240 | ONLY_ACTIVE_ARCH = YES;
241 | SDKROOT = iphoneos;
242 | };
243 | name = Debug;
244 | };
245 | 06F837C81D3671750092CEDF /* Release */ = {
246 | isa = XCBuildConfiguration;
247 | buildSettings = {
248 | ALWAYS_SEARCH_USER_PATHS = NO;
249 | CLANG_ANALYZER_NONNULL = YES;
250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
251 | CLANG_CXX_LIBRARY = "libc++";
252 | CLANG_ENABLE_MODULES = YES;
253 | CLANG_ENABLE_OBJC_ARC = YES;
254 | CLANG_WARN_BOOL_CONVERSION = YES;
255 | CLANG_WARN_CONSTANT_CONVERSION = YES;
256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
257 | CLANG_WARN_EMPTY_BODY = YES;
258 | CLANG_WARN_ENUM_CONVERSION = YES;
259 | CLANG_WARN_INT_CONVERSION = YES;
260 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
261 | CLANG_WARN_UNREACHABLE_CODE = YES;
262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
264 | COPY_PHASE_STRIP = NO;
265 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
266 | ENABLE_NS_ASSERTIONS = NO;
267 | ENABLE_STRICT_OBJC_MSGSEND = YES;
268 | GCC_C_LANGUAGE_STANDARD = gnu99;
269 | GCC_NO_COMMON_BLOCKS = YES;
270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
272 | GCC_WARN_UNDECLARED_SELECTOR = YES;
273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
274 | GCC_WARN_UNUSED_FUNCTION = YES;
275 | GCC_WARN_UNUSED_VARIABLE = YES;
276 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
277 | MTL_ENABLE_DEBUG_INFO = NO;
278 | SDKROOT = iphoneos;
279 | VALIDATE_PRODUCT = YES;
280 | };
281 | name = Release;
282 | };
283 | 06F837CA1D3671750092CEDF /* Debug */ = {
284 | isa = XCBuildConfiguration;
285 | buildSettings = {
286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
287 | DEVELOPMENT_TEAM = F4PC9X3XW8;
288 | FRAMEWORK_SEARCH_PATHS = (
289 | "$(inherited)",
290 | "$(PROJECT_DIR)",
291 | );
292 | INFOPLIST_FILE = QRCodeReader/Info.plist;
293 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
294 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
295 | PRODUCT_BUNDLE_IDENTIFIER = com.csdemo.QRCodeReader;
296 | PRODUCT_NAME = "$(TARGET_NAME)";
297 | };
298 | name = Debug;
299 | };
300 | 06F837CB1D3671750092CEDF /* Release */ = {
301 | isa = XCBuildConfiguration;
302 | buildSettings = {
303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
304 | DEVELOPMENT_TEAM = F4PC9X3XW8;
305 | FRAMEWORK_SEARCH_PATHS = (
306 | "$(inherited)",
307 | "$(PROJECT_DIR)",
308 | );
309 | INFOPLIST_FILE = QRCodeReader/Info.plist;
310 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
312 | PRODUCT_BUNDLE_IDENTIFIER = com.csdemo.QRCodeReader;
313 | PRODUCT_NAME = "$(TARGET_NAME)";
314 | };
315 | name = Release;
316 | };
317 | /* End XCBuildConfiguration section */
318 |
319 | /* Begin XCConfigurationList section */
320 | 06F837AD1D3671740092CEDF /* Build configuration list for PBXProject "QRCodeReader" */ = {
321 | isa = XCConfigurationList;
322 | buildConfigurations = (
323 | 06F837C71D3671750092CEDF /* Debug */,
324 | 06F837C81D3671750092CEDF /* Release */,
325 | );
326 | defaultConfigurationIsVisible = 0;
327 | defaultConfigurationName = Release;
328 | };
329 | 06F837C91D3671750092CEDF /* Build configuration list for PBXNativeTarget "QRCodeReader" */ = {
330 | isa = XCConfigurationList;
331 | buildConfigurations = (
332 | 06F837CA1D3671750092CEDF /* Debug */,
333 | 06F837CB1D3671750092CEDF /* Release */,
334 | );
335 | defaultConfigurationIsVisible = 0;
336 | defaultConfigurationName = Release;
337 | };
338 | /* End XCConfigurationList section */
339 | };
340 | rootObject = 06F837AA1D3671740092CEDF /* Project object */;
341 | }
342 |
--------------------------------------------------------------------------------