├── WeChatQRCodeScanner
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── KKQRCodeImageScanner.h
│ ├── KKQRCodeScannerResult.h
│ ├── KKQRCodeScannerView.h
│ ├── KKQRCodeScannerResult.m
│ ├── KKQRCodeImageScanner.mm
│ └── KKQRCodeScannerView.mm
├── _Pods.xcodeproj
├── Example
├── Tests
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── Tests-Prefix.pch
│ ├── Tests-Info.plist
│ └── Tests.m
├── WeChatQRCodeScanner
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── test1.png
│ ├── test2.png
│ ├── test3.png
│ ├── KKViewController.h
│ ├── KKAppDelegate.h
│ ├── KKQRCodeScannerController.h
│ ├── main.m
│ ├── KKImageScannerResultViewController.h
│ ├── KKImageScannerResultViewController.m
│ ├── WeChatQRCodeScanner-Info.plist
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── KKImageScannerResultViewController.xib
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── KKAppDelegate.m
│ ├── KKQRCodeScannerController.xib
│ ├── KKViewController.m
│ └── KKQRCodeScannerController.m
├── Podfile
├── WeChatQRCodeScanner.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── WeChatQRCodeScanner-Example.xcscheme
│ └── project.pbxproj
├── WeChatQRCodeScanner.xcworkspace
│ └── contents.xcworkspacedata
└── Podfile.lock
├── images
└── IMG_0463.PNG
├── script
├── downloadlib.sh
└── build.sh
├── .travis.yml
├── .gitignore
├── LICENSE
├── README.md
├── WeChatQRCodeScanner.podspec
└── patch
└── 0001-add-iOS-model-file-support.patch
/WeChatQRCodeScanner/Assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------
/Example/Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/images/IMG_0463.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x1306a94/WeChatQRCodeScanner/HEAD/images/IMG_0463.PNG
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/test1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x1306a94/WeChatQRCodeScanner/HEAD/Example/WeChatQRCodeScanner/test1.png
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/test2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x1306a94/WeChatQRCodeScanner/HEAD/Example/WeChatQRCodeScanner/test2.png
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/test3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0x1306a94/WeChatQRCodeScanner/HEAD/Example/WeChatQRCodeScanner/test3.png
--------------------------------------------------------------------------------
/Example/Tests/Tests-Prefix.pch:
--------------------------------------------------------------------------------
1 | // The contents of this file are implicitly included at the beginning of every test case source file.
2 |
3 | #ifdef __OBJC__
4 |
5 | @import FBSnapshotTestCase;
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | platform :ios, '9.0'
4 |
5 | target 'WeChatQRCodeScanner_Example' do
6 | pod 'WeChatQRCodeScanner', :path => '../'
7 |
8 | target 'WeChatQRCodeScanner_Tests' do
9 | inherit! :search_paths
10 |
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKViewController.h
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KKViewController : UIViewController
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - WeChatQRCodeScanner (1.0.0)
3 |
4 | DEPENDENCIES:
5 | - WeChatQRCodeScanner (from `../`)
6 |
7 | EXTERNAL SOURCES:
8 | WeChatQRCodeScanner:
9 | :path: "../"
10 |
11 | SPEC CHECKSUMS:
12 | WeChatQRCodeScanner: 5b7851b29fcab26cb71ec9d7b4bc6f641c4e088e
13 |
14 | PODFILE CHECKSUM: de06439c12004fc975d7a0e52fed5299b6df7dd4
15 |
16 | COCOAPODS: 1.10.1
17 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKAppDelegate.h
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface KKAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
17 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKQRCodeScannerController.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerController.h
3 | // WeChatQRCodeScanner_Example
4 | //
5 | // Created by king on 2021/2/3.
6 | // Copyright © 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface KKQRCodeScannerController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import "KKAppDelegate.h"
10 | #import
11 |
12 | int main(int argc, char *argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([KKAppDelegate class]));
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeImageScanner.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeImageScanner.h
3 | // Pods
4 | //
5 | // Created by king on 2021/2/26.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @class KKQRCodeScannerResult;
13 | @class UIImage;
14 |
15 | @interface KKQRCodeImageScanner : NSObject
16 |
17 | - (NSArray *)scannerForImage:(UIImage *)image;
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
22 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKImageScannerResultViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKImageScannerResultViewController.h
3 | // WeChatQRCodeScanner_Example
4 | //
5 | // Created by king on 2021/2/27.
6 | // Copyright © 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface KKImageScannerResultViewController : UIViewController
14 | @property (nonatomic, strong) UIImage *image;
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/script/downloadlib.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -ex
4 |
5 | CUR_DIR=$PWD
6 | DOWNLOAD_DIR=$CUR_DIR/download_dir
7 | ZIP_FILE=$DOWNLOAD_DIR/$1.zip
8 | LIB_UNZIP_DIR=$DOWNLOAD_DIR/lib
9 |
10 | mkdir -p $DOWNLOAD_DIR
11 |
12 | wget https://github.com/0x1306a94/WeChatQRCodeScanner/releases/download/$1/$1.zip -O $ZIP_FILE
13 |
14 | unzip -o $ZIP_FILE -d $DOWNLOAD_DIR
15 |
16 | POD_DIR=$CUR_DIR/WeChatQRCodeScanner
17 |
18 | mkdir -p $POD_DIR/Frameworks $POD_DIR/Models
19 |
20 | cp -rf $LIB_UNZIP_DIR/opencv2.framework $POD_DIR/Frameworks
21 | cp -rf $LIB_UNZIP_DIR/wechat_qrcode $POD_DIR/Models
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode12.4
6 | language: objective-c
7 |
8 | branches:
9 | only:
10 | - master
11 | # cache: cocoapods
12 | # podfile: Example/Podfile
13 | # before_install:
14 | # - gem install cocoapods # Since Travis is not always on latest version
15 | # - pod install --project-directory=Example
16 | script:
17 | # - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/WeChatQRCodeScanner.xcworkspace -scheme WeChatQRCodeScanner-Example -sdk iphonesimulator14.4 ONLY_ACTIVE_ARCH=NO | xcpretty
18 | - pod lib lint --verbose --allow-warnings
19 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeScannerResult.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerResult.h
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by king on 2021/2/3.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @interface KKQRCodeScannerResult : NSObject
13 | /// 识别的内容
14 | @property (nonatomic, copy, readonly) NSString *content;
15 | /// 二维码区域 基于原始图像坐标区域
16 | @property (nonatomic, assign, readonly) CGRect rectOfImage;
17 | /// 二维码区域 基于当前扫描容器View坐标系区域
18 | @property (nonatomic, assign, readonly) CGRect rectOfView;
19 |
20 | - (instancetype)initWithContent:(NSString *)content rectOfImage:(CGRect)rectOfImage rectOfView:(CGRect)rectOfView;
21 | @end
22 |
23 | NS_ASSUME_NONNULL_END
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // WeChatQRCodeScannerTests.m
3 | // WeChatQRCodeScannerTests
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | @import XCTest;
10 |
11 | @interface Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation Tests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
36 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeScannerView.h:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerView.h
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by king on 2021/2/1.
6 | //
7 |
8 | #import
9 |
10 | NS_ASSUME_NONNULL_BEGIN
11 |
12 | @protocol KKQRCodeScannerViewDelegate;
13 | @class KKQRCodeScannerResult;
14 |
15 | @interface KKQRCodeScannerView : UIView
16 | @property (nonatomic, weak) id delegate;
17 |
18 | - (void)startScanner:(NSError **)error;
19 |
20 | - (void)stopScanner;
21 | @end
22 |
23 | @protocol KKQRCodeScannerViewDelegate
24 |
25 | @required
26 | - (BOOL)qrcodeScannerView:(KKQRCodeScannerView *)scannerView didScanner:(NSArray *)results elapsedTime:(NSTimeInterval)elapsedTime;
27 | @end
28 | NS_ASSUME_NONNULL_END
29 |
30 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeScannerResult.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerResult.m
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by king on 2021/2/3.
6 | //
7 |
8 | #import "KKQRCodeScannerResult.h"
9 |
10 | @interface KKQRCodeScannerResult ()
11 | /// 识别的内容
12 | @property (nonatomic, copy) NSString *content;
13 | /// 二维码区域 基于原始图像坐标区域
14 | @property (nonatomic, assign) CGRect rectOfImage;
15 | /// 二维码区域 基于当前扫描容器View坐标系区域
16 | @property (nonatomic, assign) CGRect rectOfView;
17 | @end
18 |
19 | @implementation KKQRCodeScannerResult
20 |
21 | - (instancetype)initWithContent:(NSString *)content rectOfImage:(CGRect)rectOfImage rectOfView:(CGRect)rectOfView {
22 | if (self == [super init]) {
23 | _content = content;
24 | _rectOfImage = rectOfImage;
25 | _rectOfView = rectOfView;
26 | }
27 | return self;
28 | }
29 | @end
30 |
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OS X
2 | .DS_Store
3 |
4 | # Xcode
5 | build/
6 | *.pbxuser
7 | !default.pbxuser
8 | *.mode1v3
9 | !default.mode1v3
10 | *.mode2v3
11 | !default.mode2v3
12 | *.perspectivev3
13 | !default.perspectivev3
14 | xcuserdata/
15 | *.xccheckout
16 | profile
17 | *.moved-aside
18 | DerivedData
19 | *.hmap
20 | *.ipa
21 |
22 | # Bundler
23 | .bundle
24 |
25 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
26 | # Carthage/Checkouts
27 |
28 | Carthage/Build
29 |
30 | # We recommend against adding the Pods directory to your .gitignore. However
31 | # you should judge for yourself, the pros and cons are mentioned at:
32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
33 | #
34 | # Note: if you ignore the Pods directory, make sure to uncomment
35 | # `pod install` in .travis.yml
36 | #
37 |
38 | Example/Pods/
39 | download_dir/
40 | work_dir/
41 | WeChatQRCodeScanner/Frameworks/*.framework
42 | WeChatQRCodeScanner/Models/wechat_qrcode
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2021 0x1306a94 <0x1306a94@gmail.com>
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKImageScannerResultViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKImageScannerResultViewController.m
3 | // WeChatQRCodeScanner_Example
4 | //
5 | // Created by king on 2021/2/27.
6 | // Copyright © 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import "KKImageScannerResultViewController.h"
10 |
11 | @import AVFoundation.AVUtilities;
12 |
13 | @interface KKImageScannerResultViewController ()
14 | @property (nonatomic, strong) UIImageView *imageView;
15 | @end
16 |
17 | @implementation KKImageScannerResultViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view from its nib.
22 | [self.view addSubview:self.imageView];
23 | }
24 |
25 | - (void)viewDidAppear:(BOOL)animated {
26 | [super viewDidAppear:animated];
27 |
28 | CGRect frame = AVMakeRectWithAspectRatioInsideRect(self.image.size, self.view.bounds);
29 | self.imageView.frame = frame;
30 | self.imageView.image = self.image;
31 | }
32 |
33 | #pragma mark - lazy
34 | - (UIImageView *)imageView {
35 | if (!_imageView) {
36 | _imageView = [[UIImageView alloc] init];
37 | _imageView.contentMode = UIViewContentModeScaleAspectFit;
38 | }
39 | return _imageView;
40 | }
41 |
42 | @end
43 |
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WeChatQRCodeScanner
2 |
3 | [](https://travis-ci.org/0x1306a94/WeChatQRCodeScanner)
4 | [](https://cocoapods.org/pods/WeChatQRCodeScanner)
5 | [](https://cocoapods.org/pods/WeChatQRCodeScanner)
6 | [](https://cocoapods.org/pods/WeChatQRCodeScanner)
7 |
8 | ## Example
9 |
10 | * 基本上每个App都有自己的扫码样式,所以本库并未在UI上细化实现
11 | * [查看扫码识别示例](https://youtu.be/ORlSBrc5Dtk) 参考 [KKQRCodeScannerController](https://github.com/0x1306a94/WeChatQRCodeScanner/blob/master/Example/WeChatQRCodeScanner/KKQRCodeScannerController.m)
12 | * 图片识别示例, 参考 [KKViewController](https://github.com/0x1306a94/WeChatQRCodeScanner/blob/master/Example/WeChatQRCodeScanner/KKViewController.m#L34)
13 | 
14 |
15 | ## Requirements
16 |
17 | ## Installation
18 |
19 | ```ruby
20 | pod 'WeChatQRCodeScanner'
21 | ```
22 |
23 | ## Author
24 |
25 | 0x1306a94, 0x1306a94@gmail.com
26 |
27 | ## License
28 |
29 | WeChatQRCodeScanner is available under the MIT license. See the LICENSE file for more info.
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/WeChatQRCodeScanner-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
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.0
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | NSCameraUsageDescription
47 | 使用相机扫描二维码
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/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 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKImageScannerResultViewController.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKAppDelegate.m
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import "KKAppDelegate.h"
10 |
11 | @implementation KKAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
14 | // Override point for customization after application launch.
15 | return YES;
16 | }
17 |
18 | - (void)applicationWillResignActive:(UIApplication *)application {
19 | // 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.
20 | // 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.
21 | }
22 |
23 | - (void)applicationDidEnterBackground:(UIApplication *)application {
24 | // 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.
25 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
26 | }
27 |
28 | - (void)applicationWillEnterForeground:(UIApplication *)application {
29 | // 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.
30 | }
31 |
32 | - (void)applicationDidBecomeActive:(UIApplication *)application {
33 | // 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.
34 | }
35 |
36 | - (void)applicationWillTerminate:(UIApplication *)application {
37 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
38 | }
39 |
40 | @end
41 |
42 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'WeChatQRCodeScanner'
3 | s.version = '1.1.0'
4 | s.summary = 'WeChatQRCodeScanner.'
5 | s.description = <<-DESC
6 | 微信开源二维码识别引擎
7 | DESC
8 |
9 | s.homepage = 'https://github.com/0x1306a94/WeChatQRCodeScanner'
10 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
11 | s.license = { :type => 'MIT', :file => 'LICENSE' }
12 | s.author = { '0x1306a94' => '0x1306a94@gmail.com' }
13 | s.source = { :git => 'https://github.com/0x1306a94/WeChatQRCodeScanner.git', :tag => s.version.to_s }
14 | # s.social_media_url = 'https://twitter.com/'
15 |
16 | s.platform = :ios, '11.0'
17 |
18 | s.source_files = 'WeChatQRCodeScanner/Classes/**/*.{h,m,mm}'
19 |
20 | s.preserve_paths = [
21 | 'WeChatQRCodeScanner/Frameworks',
22 | 'WeChatQRCodeScanner/Models',
23 | # 'patch',
24 | # 'script/build.sh'
25 | 'script/downloadlib.sh'
26 | ]
27 |
28 | s.vendored_frameworks = [
29 | 'WeChatQRCodeScanner/Frameworks/*.framework'
30 | ]
31 |
32 | # s.prepare_command =<<-CMD
33 | # script/build.sh "4.5.1"
34 | # CMD
35 |
36 | s.prepare_command =<<-CMD
37 | script/downloadlib.sh "lib-v1"
38 | CMD
39 |
40 | s.resource_bundles = {
41 | 'WeChatQRCodeScanner' => ['WeChatQRCodeScanner/Models/*']
42 | }
43 |
44 | # s.prefix_header_file = false
45 | s.pod_target_xcconfig = {
46 | # 'OTHER_CPLUSPLUSFLAGS' => '-fmodules -fcxx-modules'
47 | 'CLANG_WARN_DOCUMENTATION_COMMENTS' => 'NO',
48 | 'VALID_ARCHS' => 'arm64 x86_64',
49 | 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
50 | }
51 |
52 | # s.user_target_xcconfig = {
53 | # 'OTHER_CPLUSPLUSFLAGS' => '-fmodules -fcxx-modules'
54 | # }
55 |
56 | # s.public_header_files = 'Pod/Classes/**/*.h'
57 | s.frameworks = [
58 | 'AVFoundation',
59 | 'CoreImage',
60 | 'CoreGraphics',
61 | 'QuartzCore',
62 | 'Accelerate',
63 | 'CoreVideo',
64 | 'CoreMedia'
65 | ]
66 |
67 | s.libraries = [
68 | 'c++'
69 | ]
70 | # s.dependency 'AFNetworking', '~> 2.3'
71 | end
72 |
--------------------------------------------------------------------------------
/script/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -ex
4 |
5 | echo "OpenCV Version: $1"
6 |
7 | CUR_DIR=$PWD
8 | WORK_DIR=$PWD/work_dir
9 | mkdir -p $WORK_DIR
10 |
11 | OPENCV_SOURCE_DIR=$WORK_DIR/opencv_$1
12 | OPENCV_SOURCE_CONTRIB_DIR=$WORK_DIR/opencv_contrib
13 |
14 | if [[ ! -d "$OPENCV_SOURCE_DIR" ]]; then
15 | echo "下载OpenCV 源码 ...."
16 | git clone --single-branch --depth 1 -b $1 https://github.com/opencv/opencv.git $OPENCV_SOURCE_DIR
17 | fi
18 |
19 | if [[ ! -d "$OPENCV_SOURCE_CONTRIB_DIR" ]]; then
20 | echo "下载 wechat_qrcode 源码 ...."
21 | git clone https://github.com/opencv/opencv_contrib $OPENCV_SOURCE_CONTRIB_DIR
22 | cd $OPENCV_SOURCE_CONTRIB_DIR
23 | git checkout -b ios-model-file-support c10b07de6d9fcc3222fd4d9ec865b99fd1798e2f
24 | # 修复 iOS 端无法加载模型文件
25 | git apply $CUR_DIR/patch/0001-add-iOS-model-file-support.patch
26 | git add .
27 | git commit -m "add iOS model file support"
28 | cd $CUR_DIR
29 | fi
30 |
31 | WECHAT_QR_CODE_SOURCE_DIR=$WORK_DIR/opencv_contrib_wechat_qrcode
32 |
33 | mkdir -p $WECHAT_QR_CODE_SOURCE_DIR/modules
34 |
35 | OUT_DIR=$WORK_DIR/ios
36 |
37 | if [[ ! -d "$OUT_DIR/opencv2.framework" ]]; then
38 | echo "开始编译 ...."
39 | cp -rf $OPENCV_SOURCE_CONTRIB_DIR/modules/wechat_qrcode $WECHAT_QR_CODE_SOURCE_DIR/modules
40 |
41 | cd $WORK_DIR
42 | python $OPENCV_SOURCE_DIR/platforms/ios/build_framework.py \
43 | --opencv $OPENCV_SOURCE_DIR \
44 | --contrib $WECHAT_QR_CODE_SOURCE_DIR \
45 | --without stitching \
46 | --without objdetect \
47 | --without world \
48 | --without calib3d \
49 | --without highgui \
50 | --without imgcodecs \
51 | --without features2d \
52 | --without flann \
53 | --without gapi \
54 | --without photo \
55 | --without ml \
56 | --without java \
57 | --without python \
58 | --without js \
59 | --without ts \
60 | --without video \
61 | --without videoio \
62 | --iphoneos_archs arm64 \
63 | --iphonesimulator_archs x86_64 \
64 | --disable-bitcode \
65 | $OUT_DIR
66 | fi
67 |
68 | POD_DIR=$CUR_DIR/WeChatQRCodeScanner
69 |
70 | mkdir -p $POD_DIR/Frameworks $POD_DIR/Models
71 |
72 | if [[ ! -d "$POD_DIR/Frameworks/opencv2.framework" ]]; then
73 | cp -rf $OUT_DIR/build/build-arm64-iphoneos/downloads/wechat_qrcode $POD_DIR/Models/
74 | cp -rf $OUT_DIR/opencv2.framework $POD_DIR/Frameworks
75 | fi
76 |
77 | cd $CUR_DIR
78 |
79 | # exit -1
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKQRCodeScannerController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/patch/0001-add-iOS-model-file-support.patch:
--------------------------------------------------------------------------------
1 | From fd3c9a5b488458b49c66ae9f6d0b0b183a0adc39 Mon Sep 17 00:00:00 2001
2 | From: 0x1306a94 <0x1306a94@gmail.com>
3 | Date: Tue, 2 Feb 2021 15:29:07 +0800
4 | Subject: [PATCH] add iOS model file support
5 |
6 | ---
7 | modules/wechat_qrcode/src/wechat_qrcode.cpp | 21 ++++++++++++++++++++-
8 | 1 file changed, 20 insertions(+), 1 deletion(-)
9 |
10 | diff --git a/modules/wechat_qrcode/src/wechat_qrcode.cpp b/modules/wechat_qrcode/src/wechat_qrcode.cpp
11 | index d4856ba2..75282030 100644
12 | --- a/modules/wechat_qrcode/src/wechat_qrcode.cpp
13 | +++ b/modules/wechat_qrcode/src/wechat_qrcode.cpp
14 | @@ -13,8 +13,17 @@
15 | #include "opencv2/core/utils/filesystem.hpp"
16 | #include "scale/super_scale.hpp"
17 | #include "zxing/result.hpp"
18 | +
19 | +#include
20 | +
21 | namespace cv {
22 | namespace wechat_qrcode {
23 | +
24 | +static bool exists(const string& path) {
25 | + struct stat buffer;
26 | + return (stat(path.c_str(), &buffer) == 0);
27 | +}
28 | +
29 | class WeChatQRCode::Impl {
30 | public:
31 | Impl() {}
32 | @@ -53,8 +62,13 @@ WeChatQRCode::WeChatQRCode(const String& detector_prototxt_path,
33 | if (!detector_caffe_model_path.empty() && !detector_prototxt_path.empty()) {
34 | // initialize detector model (caffe)
35 | p->use_nn_detector_ = true;
36 | +#if defined(OPENCV_HAVE_FILESYSTEM_SUPPORT) && OPENCV_HAVE_FILESYSTEM_SUPPORT
37 | CV_Assert(utils::fs::exists(detector_prototxt_path));
38 | CV_Assert(utils::fs::exists(detector_caffe_model_path));
39 | +#else
40 | + CV_Assert(wechat_qrcode::exists(detector_prototxt_path));
41 | + CV_Assert(wechat_qrcode::exists(detector_caffe_model_path));
42 | +#endif
43 | p->detector_ = make_shared();
44 | auto ret = p->detector_->init(detector_prototxt_path, detector_caffe_model_path);
45 | CV_Assert(ret == 0);
46 | @@ -69,8 +83,13 @@ WeChatQRCode::WeChatQRCode(const String& detector_prototxt_path,
47 | if (!super_resolution_prototxt_path.empty() && !super_resolution_caffe_model_path.empty()) {
48 | p->use_nn_sr_ = true;
49 | // initialize dnn model (caffe format)
50 | +#if defined(OPENCV_HAVE_FILESYSTEM_SUPPORT) && OPENCV_HAVE_FILESYSTEM_SUPPORT
51 | CV_Assert(utils::fs::exists(super_resolution_prototxt_path));
52 | CV_Assert(utils::fs::exists(super_resolution_caffe_model_path));
53 | +#else
54 | + CV_Assert(wechat_qrcode::exists(super_resolution_prototxt_path));
55 | + CV_Assert(wechat_qrcode::exists(super_resolution_caffe_model_path));
56 | +#endif
57 | auto ret = p->super_resolution_model_->init(super_resolution_prototxt_path,
58 | super_resolution_caffe_model_path);
59 | CV_Assert(ret == 0);
60 | @@ -202,4 +221,4 @@ vector WeChatQRCode::Impl::getScaleList(const int width, const int height
61 | return {0.5, 1.0};
62 | }
63 | } // namespace wechat_qrcode
64 | -} // namespace cv
65 | \ No newline at end of file
66 | +} // namespace cv
67 | --
68 | 2.29.2
69 |
70 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKViewController.m
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by 0x1306a94 on 02/01/2021.
6 | // Copyright (c) 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import "KKViewController.h"
10 |
11 | #import "KKImageScannerResultViewController.h"
12 | #import "KKQRCodeScannerController.h"
13 |
14 | #import
15 | #import
16 |
17 | @interface KKViewController ()
18 | @property (nonatomic, strong) KKQRCodeImageScanner *scanner;
19 | @end
20 |
21 | @implementation KKViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 |
26 | self.title = @"微信二维码识别引擎";
27 | }
28 |
29 | - (IBAction)scannerButtonAction:(UIButton *)sender {
30 | KKQRCodeScannerController *vc = [[KKQRCodeScannerController alloc] init];
31 | [self presentViewController:vc animated:YES completion:nil];
32 | }
33 |
34 | - (IBAction)imageScannerButtonAction:(UIButton *)sender {
35 | UIImage *image = [UIImage imageNamed:@"test3"];
36 | NSTimeInterval start = CACurrentMediaTime();
37 | NSArray *results = [self.scanner scannerForImage:image];
38 | NSTimeInterval elapsedTime = CACurrentMediaTime() - start;
39 | if (!results) {
40 | return;
41 | }
42 | NSMutableString *string = [NSMutableString stringWithFormat:@"\n>>>>>>>>>>>>>>>> 识别结果 >>>>>>>>>>>>>>>>\n"];
43 | [string appendFormat:@"耗时: %fs\n", elapsedTime];
44 | [results enumerateObjectsUsingBlock:^(KKQRCodeScannerResult *_Nonnull obj, NSUInteger idx, BOOL *_Nonnull stop) {
45 | [string appendFormat:@"%@\ncontent: %@\nrectOfImage %@\n", obj, obj.content, NSStringFromCGRect(obj.rectOfImage)];
46 | [string appendString:@"-----------------------------------\n"];
47 | }];
48 |
49 | NSLog(@"%@", string);
50 |
51 | UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat];
52 | format.scale = 1.0;
53 |
54 | UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size format:format];
55 |
56 | UIImage *drawImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) {
57 | [image drawAtPoint:CGPointZero];
58 | do {
59 | UIBezierPath *path = [UIBezierPath bezierPathWithRect:renderer.format.bounds];
60 | path.lineWidth = 5;
61 | [UIColor.redColor setStroke];
62 | [path stroke];
63 | } while (0);
64 |
65 | for (KKQRCodeScannerResult *item in results) {
66 | UIBezierPath *path = [UIBezierPath bezierPathWithRect:item.rectOfImage];
67 | path.lineWidth = 5;
68 | [UIColor.yellowColor setStroke];
69 | [path stroke];
70 | }
71 | }];
72 |
73 | KKImageScannerResultViewController *vc = [[KKImageScannerResultViewController alloc] init];
74 |
75 | vc.image = drawImage;
76 |
77 | [self presentViewController:vc animated:YES completion:nil];
78 | }
79 |
80 | #pragma mark - lazy
81 | - (KKQRCodeImageScanner *)scanner {
82 | if (!_scanner) {
83 | _scanner = [[KKQRCodeImageScanner alloc] init];
84 | }
85 | return _scanner;
86 | }
87 | @end
88 |
89 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/KKQRCodeScannerController.m:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerController.m
3 | // WeChatQRCodeScanner_Example
4 | //
5 | // Created by king on 2021/2/3.
6 | // Copyright © 2021 0x1306a94. All rights reserved.
7 | //
8 |
9 | #import "KKQRCodeScannerController.h"
10 |
11 | #import
12 | #import
13 |
14 | @interface KKQRCodeScannerController ()
15 | @property (nonatomic, strong) KKQRCodeScannerView *scannerView;
16 | @property (nonatomic, weak) IBOutlet UILabel *tipsLabel;
17 |
18 | @property (nonatomic, strong) CALayer *containerLayer;
19 | @property (nonatomic, strong) NSMutableArray *reuseMarkLayers;
20 | @end
21 |
22 | @implementation KKQRCodeScannerController
23 |
24 | - (void)viewDidLoad {
25 | [super viewDidLoad];
26 |
27 | self.scannerView = [[KKQRCodeScannerView alloc] initWithFrame:self.view.bounds];
28 |
29 | self.scannerView.backgroundColor = UIColor.whiteColor;
30 |
31 | [self.view insertSubview:self.scannerView atIndex:0];
32 |
33 | self.scannerView.translatesAutoresizingMaskIntoConstraints = NO;
34 | [NSLayoutConstraint activateConstraints:@[
35 | [self.scannerView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
36 | [self.scannerView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor],
37 | [self.scannerView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
38 | [self.scannerView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor],
39 | ]];
40 |
41 | self.tipsLabel.textColor = UIColor.redColor;
42 | self.tipsLabel.text = @"";
43 |
44 | self.reuseMarkLayers = [NSMutableArray arrayWithCapacity:5];
45 |
46 | self.containerLayer = [CALayer layer];
47 | self.containerLayer.backgroundColor = UIColor.clearColor.CGColor;
48 |
49 | [self.scannerView.layer addSublayer:self.containerLayer];
50 | }
51 |
52 | - (void)viewDidAppear:(BOOL)animated {
53 | [super viewDidAppear:animated];
54 | self.scannerView.delegate = self;
55 | self.containerLayer.frame = self.scannerView.layer.bounds;
56 | [self.scannerView startScanner:nil];
57 | }
58 |
59 | - (void)viewDidDisappear:(BOOL)animated {
60 | [super viewDidDisappear:animated];
61 | self.scannerView.delegate = nil;
62 | [self.scannerView stopScanner];
63 | }
64 |
65 | #pragma mark - clear
66 | - (void)clearMarkLayers {
67 | if (self.containerLayer.sublayers.count > 0) {
68 | [self.reuseMarkLayers addObjectsFromArray:self.containerLayer.sublayers];
69 | [self.containerLayer.sublayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)];
70 | }
71 | }
72 |
73 | #pragma mark - KKQRCodeScannerViewDelegate
74 | - (BOOL)qrcodeScannerView:(KKQRCodeScannerView *)scannerView didScanner:(NSArray *)results elapsedTime:(NSTimeInterval)elapsedTime {
75 | [self clearMarkLayers];
76 | if (!results || results.count == 0) {
77 | self.tipsLabel.text = @"";
78 | return NO;
79 | }
80 | NSMutableString *text = [NSMutableString string];
81 | for (KKQRCodeScannerResult *element in results) {
82 | [text appendFormat:@"\n%@", element.content];
83 |
84 | CAShapeLayer *markLayer = nil;
85 | if (self.reuseMarkLayers.count > 0) {
86 | markLayer = self.reuseMarkLayers.lastObject;
87 | [self.reuseMarkLayers removeLastObject];
88 | } else {
89 | markLayer = [CAShapeLayer layer];
90 | markLayer.fillColor = UIColor.clearColor.CGColor;
91 | markLayer.strokeColor = UIColor.greenColor.CGColor;
92 | markLayer.lineWidth = 2;
93 | markLayer.fillRule = kCAFillRuleEvenOdd;
94 | }
95 |
96 | UIBezierPath *path = [UIBezierPath bezierPathWithRect:element.rectOfView];
97 | markLayer.path = path.CGPath;
98 | [self.containerLayer addSublayer:markLayer];
99 | }
100 | [text appendFormat:@"\n耗时: %fs", elapsedTime];
101 |
102 | self.tipsLabel.text = text;
103 |
104 | return NO;
105 | }
106 |
107 | @end
108 |
109 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner.xcodeproj/xcshareddata/xcschemes/WeChatQRCodeScanner-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
42 |
48 |
49 |
50 |
51 |
52 |
62 |
64 |
70 |
71 |
72 |
73 |
79 |
81 |
87 |
88 |
89 |
90 |
92 |
93 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeImageScanner.mm:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeImageScanner.m
3 | // Pods
4 | //
5 | // Created by king on 2021/2/26.
6 | //
7 |
8 | #import "KKQRCodeImageScanner.h"
9 |
10 | #import "KKQRCodeScannerResult.h"
11 |
12 | #import
13 | #import
14 | #import
15 |
16 | @interface KKQRCodeImageScanner ()
17 | @property (nonatomic, assign) cv::Ptr detector;
18 | @end
19 |
20 | @implementation KKQRCodeImageScanner
21 | - (instancetype)init {
22 | if (self == [super init]) {
23 | [self commonInit];
24 | }
25 | return self;
26 | }
27 |
28 | #pragma mark - Initial Methods
29 | - (void)commonInit {
30 | NSBundle *mainBundle = [NSBundle bundleForClass:self.class];
31 | NSBundle *bundle = [NSBundle bundleWithPath:[mainBundle pathForResource:@"WeChatQRCodeScanner" ofType:@"bundle"]];
32 | NSString *detector_prototxt_path = [bundle pathForResource:@"detect" ofType:@"prototxt" inDirectory:@"wechat_qrcode"];
33 | NSString *detector_caffe_model_path = [bundle pathForResource:@"detect" ofType:@"caffemodel" inDirectory:@"wechat_qrcode"];
34 | NSString *super_resolution_prototxt_path = [bundle pathForResource:@"sr" ofType:@"prototxt" inDirectory:@"wechat_qrcode"];
35 | NSString *super_resolution_caffe_model_path = [bundle pathForResource:@"sr" ofType:@"caffemodel" inDirectory:@"wechat_qrcode"];
36 |
37 | _detector = cv::makePtr(detector_prototxt_path.UTF8String,
38 | detector_caffe_model_path.UTF8String,
39 | super_resolution_prototxt_path.UTF8String,
40 | super_resolution_caffe_model_path.UTF8String);
41 | }
42 |
43 | - (NSArray *)scannerForImage:(UIImage *)image {
44 | if (!image) {
45 | return nil;
46 | }
47 |
48 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(image.CGImage);
49 | CGFloat cols = image.size.width;
50 | CGFloat rows = image.size.height;
51 |
52 | cv::Mat cvMat(rows, cols, CV_8UC4); // 8 bits per component, 4 channels (color channels + alpha)
53 |
54 | CGContextRef contextRef = CGBitmapContextCreate(cvMat.data, // Pointer to data
55 | cols, // Width of bitmap
56 | rows, // Height of bitmap
57 | 8, // Bits per component
58 | cvMat.step[0], // Bytes per row
59 | colorSpace, // Colorspace
60 | kCGImageAlphaNoneSkipLast |
61 | kCGBitmapByteOrderDefault); // Bitmap info flags
62 |
63 | CGContextDrawImage(contextRef, CGRectMake(0, 0, cols, rows), image.CGImage);
64 | CGContextRelease(contextRef);
65 |
66 | // cv::Mat transMat;
67 | // cv::transpose(cvMat, transMat);
68 | //
69 | // cv::Mat flipMat;
70 | // cv::flip(transMat, flipMat, 1);
71 |
72 | std::vector points;
73 | std::vector res = self.detector->detectAndDecode(cvMat, points);
74 |
75 | NSMutableArray *results = nil;
76 | if (res.size() > 0) {
77 |
78 | size_t size = res.size();
79 |
80 | results = [NSMutableArray arrayWithCapacity:size];
81 |
82 | for (size_t i = 0; i < size; i++) {
83 | NSString *content = [NSString stringWithCString:res[i].c_str() encoding:NSUTF8StringEncoding];
84 | cv::Mat &m = points[i];
85 |
86 | CGPoint topLeft = CGPointMake(m.at(0, 0), m.at(0, 1));
87 | CGPoint topRight = CGPointMake(m.at(1, 0), m.at(1, 1));
88 | CGPoint bottomLeft = CGPointMake(m.at(2, 0), m.at(2, 1));
89 | CGRect rectOfImage = (CGRect){topLeft, CGSizeMake(topRight.x - topLeft.x, bottomLeft.y - topLeft.y)};
90 |
91 | KKQRCodeScannerResult *r = [[KKQRCodeScannerResult alloc] initWithContent:content rectOfImage:rectOfImage rectOfView:CGRectZero];
92 | [results addObject:r];
93 | }
94 | }
95 |
96 | return [results copy];
97 | }
98 | @end
99 |
100 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner/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 |
32 |
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 |
--------------------------------------------------------------------------------
/WeChatQRCodeScanner/Classes/KKQRCodeScannerView.mm:
--------------------------------------------------------------------------------
1 | //
2 | // KKQRCodeScannerView.m
3 | // WeChatQRCodeScanner
4 | //
5 | // Created by king on 2021/2/1.
6 | //
7 |
8 | #import "KKQRCodeScannerView.h"
9 |
10 | #import "KKQRCodeScannerResult.h"
11 |
12 | #import
13 |
14 | #import
15 | #import
16 | #import
17 |
18 | @interface KKQRCodeScannerView ()
19 | @property (nonatomic, strong) AVCaptureSession *session;
20 | @property (nonatomic, strong) AVCaptureDeviceInput *videoInput;
21 | @property (nonatomic, strong) AVCaptureVideoDataOutput *dataOutput;
22 | @property (nonatomic, strong, readonly) AVCaptureVideoPreviewLayer *previewLayer;
23 | @property (nonatomic, assign) cv::Ptr detector;
24 | //@property (nonatomic, strong) dispatch_queue_t workQueue;
25 | @property (nonatomic, assign) BOOL stoped;
26 | @end
27 |
28 | @implementation KKQRCodeScannerView
29 | #if DEBUG
30 | - (void)dealloc {
31 | NSLog(@"[%@ dealloc]", NSStringFromClass(self.class));
32 | }
33 | #endif
34 |
35 | + (Class)layerClass {
36 | return AVCaptureVideoPreviewLayer.class;
37 | }
38 |
39 | - (AVCaptureVideoPreviewLayer *)previewLayer {
40 | return (AVCaptureVideoPreviewLayer *)self.layer;
41 | }
42 |
43 | #pragma mark - life cycle
44 | - (instancetype)initWithFrame:(CGRect)frame {
45 | if ((self = [super initWithFrame:frame])) {
46 | [self commonInit];
47 | }
48 | return self;
49 | }
50 |
51 | - (instancetype)initWithCoder:(NSCoder *)aDecoder {
52 | if ((self = [super initWithCoder:aDecoder])) {
53 | [self commonInit];
54 | }
55 | return self;
56 | }
57 |
58 | #pragma mark - Initial Methods
59 | - (void)commonInit {
60 | /*custom view u want draw in here*/
61 | self.backgroundColor = [UIColor blackColor];
62 |
63 | NSBundle *mainBundle = [NSBundle bundleForClass:self.class];
64 | NSBundle *bundle = [NSBundle bundleWithPath:[mainBundle pathForResource:@"WeChatQRCodeScanner" ofType:@"bundle"]];
65 | NSString *detector_prototxt_path = [bundle pathForResource:@"detect" ofType:@"prototxt" inDirectory:@"wechat_qrcode"];
66 | NSString *detector_caffe_model_path = [bundle pathForResource:@"detect" ofType:@"caffemodel" inDirectory:@"wechat_qrcode"];
67 | NSString *super_resolution_prototxt_path = [bundle pathForResource:@"sr" ofType:@"prototxt" inDirectory:@"wechat_qrcode"];
68 | NSString *super_resolution_caffe_model_path = [bundle pathForResource:@"sr" ofType:@"caffemodel" inDirectory:@"wechat_qrcode"];
69 |
70 | // self.detector = [[WeChatQRCode alloc] initWithDetector_prototxt_path:detector_prototxt_path detector_caffe_model_path:detector_caffe_model_path super_resolution_prototxt_path:super_resolution_prototxt_path super_resolution_caffe_model_path:super_resolution_caffe_model_path];
71 |
72 | // self.detector = [[WeChatQRCode alloc] init];
73 |
74 | _detector = cv::makePtr(detector_prototxt_path.UTF8String,
75 | detector_caffe_model_path.UTF8String,
76 | super_resolution_prototxt_path.UTF8String,
77 | super_resolution_caffe_model_path.UTF8String);
78 |
79 | self.stoped = NO;
80 |
81 | // self.workQueue = dispatch_queue_create("com.0x1306a94.qrcode.scanner.workqueue", DISPATCH_QUEUE_SERIAL);
82 | }
83 |
84 | #pragma mark - AVCaptureVideoDataOutputSampleBufferDelegate
85 | - (void)captureOutput:(AVCaptureOutput *)output didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
86 | if (self.stoped) {
87 | return;
88 | }
89 | CVImageBufferRef imgBuf = CMSampleBufferGetImageBuffer(sampleBuffer);
90 |
91 | CVPixelBufferLockBaseAddress(imgBuf, 0);
92 |
93 | void *imgBufAddr = CVPixelBufferGetBaseAddressOfPlane(imgBuf, 0);
94 |
95 | int w = (int)CVPixelBufferGetWidth(imgBuf);
96 | int h = (int)CVPixelBufferGetHeight(imgBuf);
97 |
98 | cv::Mat mat(h, w, CV_8UC4, imgBufAddr, 0);
99 |
100 | cv::Mat transMat;
101 | cv::transpose(mat, transMat);
102 |
103 | cv::Mat flipMat;
104 | cv::flip(transMat, flipMat, 1);
105 |
106 | CVPixelBufferUnlockBaseAddress(imgBuf, 0);
107 |
108 | NSTimeInterval start = CACurrentMediaTime();
109 |
110 | std::vector points;
111 | std::vector res = self.detector->detectAndDecode(flipMat, points);
112 |
113 | NSTimeInterval elapsedTime = CACurrentMediaTime() - start;
114 | if (self.stoped) {
115 | return;
116 | }
117 |
118 | NSMutableArray *results = nil;
119 | if (res.size() > 0) {
120 |
121 | size_t size = res.size();
122 |
123 | results = [NSMutableArray arrayWithCapacity:size];
124 |
125 | for (size_t i = 0; i < size; i++) {
126 | NSString *content = [NSString stringWithCString:res[i].c_str() encoding:NSUTF8StringEncoding];
127 | cv::Mat &m = points[i];
128 |
129 | CGPoint topLeft = CGPointMake(m.at(0, 0), m.at(0, 1));
130 | CGPoint topRight = CGPointMake(m.at(1, 0), m.at(1, 1));
131 | CGPoint bottomLeft = CGPointMake(m.at(2, 0), m.at(2, 1));
132 | // CGPoint bottomRight = CGPointMake(m.at(3, 0), m.at(3, 1));
133 | CGRect rectOfImage = (CGRect){topLeft, CGSizeMake(topRight.x - topLeft.x, bottomLeft.y - topLeft.y)};
134 |
135 | CGFloat sx = CGRectGetWidth(self.bounds) / h;
136 | CGFloat sy = CGRectGetHeight(self.bounds) / w;
137 |
138 | CGAffineTransform transform = CGAffineTransformIdentity;
139 |
140 | transform = CGAffineTransformScale(transform, sx, sy);
141 | CGRect rectOfView = CGRectApplyAffineTransform(rectOfImage, transform);
142 |
143 | KKQRCodeScannerResult *r = [[KKQRCodeScannerResult alloc] initWithContent:content rectOfImage:rectOfImage rectOfView:rectOfView];
144 | [results addObject:r];
145 | }
146 | }
147 | if (self.delegate && [self.delegate qrcodeScannerView:self didScanner:results elapsedTime:elapsedTime]) {
148 | self.stoped = YES;
149 | }
150 | }
151 |
152 | #pragma mark - public method
153 | - (void)startScanner:(NSError *__autoreleasing _Nullable *)error {
154 |
155 | NSError *err;
156 |
157 | AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
158 | [device lockForConfiguration:&err];
159 | if (err) {
160 | if (error) {
161 | *error = err;
162 | }
163 | return;
164 | }
165 | // if (device.isFocusPointOfInterestSupported && [device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
166 | // [device setFocusMode:AVCaptureFocusModeAutoFocus];
167 | // }
168 | device.activeVideoMaxFrameDuration = CMTimeMake(1, 25);
169 | [device unlockForConfiguration];
170 |
171 | self.videoInput = [[AVCaptureDeviceInput alloc] initWithDevice:device error:&err];
172 | if (err) {
173 | if (error) {
174 | *error = err;
175 | }
176 | return;
177 | }
178 |
179 | self.session = [[AVCaptureSession alloc] init];
180 |
181 | // self.session.sessionPreset = AVCaptureSessionPreset1280x720;
182 |
183 | if ([self.session canAddInput:self.videoInput]) {
184 | [self.session addInput:self.videoInput];
185 | }
186 |
187 | self.dataOutput = [[AVCaptureVideoDataOutput alloc] init];
188 | NSString *key = (NSString *)kCVPixelBufferPixelFormatTypeKey;
189 | NSNumber *value = [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA];
190 | NSDictionary *videoSettings = [NSDictionary dictionaryWithObject:value forKey:key];
191 | self.dataOutput.videoSettings = videoSettings;
192 | // 延迟的视频帧都被丢弃
193 | self.dataOutput.alwaysDiscardsLateVideoFrames = YES;
194 | [self.dataOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
195 | AVCaptureConnection *videoConnection = nil;
196 | for (AVCaptureConnection *connection in self.dataOutput.connections) {
197 | for (AVCaptureInputPort *port in [connection inputPorts]) {
198 | if ([[port mediaType] isEqual:AVMediaTypeVideo]) {
199 | videoConnection = connection;
200 | break;
201 | }
202 | }
203 | if (videoConnection) {
204 | break;
205 | }
206 | }
207 |
208 | videoConnection.videoOrientation = AVCaptureVideoOrientationPortrait;
209 |
210 | if ([self.session canAddOutput:self.dataOutput]) {
211 | [self.session addOutput:self.dataOutput];
212 | }
213 |
214 | self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
215 | self.previewLayer.session = self.session;
216 |
217 | if (!self.session.isRunning) {
218 | self.stoped = NO;
219 | [self.session startRunning];
220 | }
221 | }
222 |
223 | - (void)stopScanner {
224 | if (self.session && self.session.isRunning) {
225 | self.stoped = YES;
226 | [self.session stopRunning];
227 | self.session = nil;
228 | self.videoInput = nil;
229 | self.dataOutput = nil;
230 | }
231 | }
232 | @end
233 |
234 |
--------------------------------------------------------------------------------
/Example/WeChatQRCodeScanner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3454AD95E21E326BA76CB677 /* Pods_WeChatQRCodeScanner_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB69AD31953BBA5C1CD8E4B7 /* Pods_WeChatQRCodeScanner_Example.framework */; };
11 | 3C1A249825E9D7E000FBAD94 /* KKImageScannerResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C1A249625E9D7E000FBAD94 /* KKImageScannerResultViewController.m */; };
12 | 3C1A249925E9D7E000FBAD94 /* KKImageScannerResultViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C1A249725E9D7E000FBAD94 /* KKImageScannerResultViewController.xib */; };
13 | 3CB6578625CA42FA005E6951 /* KKQRCodeScannerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CB6578425CA42FA005E6951 /* KKQRCodeScannerController.m */; };
14 | 3CB6578725CA42FA005E6951 /* KKQRCodeScannerController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3CB6578525CA42FA005E6951 /* KKQRCodeScannerController.xib */; };
15 | 3CCB206425E8EA1B00EA7F89 /* test1.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CCB206325E8EA1B00EA7F89 /* test1.png */; };
16 | 3CCB207025E8F06D00EA7F89 /* test2.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CCB206F25E8F06D00EA7F89 /* test2.png */; };
17 | 3CCB207425E8F12300EA7F89 /* test3.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CCB207325E8F12300EA7F89 /* test3.png */; };
18 | 490AB707747EDE447E7F63FB /* Pods_WeChatQRCodeScanner_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D7BF3A4C5551C87D336F081 /* Pods_WeChatQRCodeScanner_Tests.framework */; };
19 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
20 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
21 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
22 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
23 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
24 | 6003F59E195388D20070C39A /* KKAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* KKAppDelegate.m */; };
25 | 6003F5A7195388D20070C39A /* KKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* KKViewController.m */; };
26 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
27 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
28 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
29 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
30 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
31 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
32 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
33 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
34 | /* End PBXBuildFile section */
35 |
36 | /* Begin PBXContainerItemProxy section */
37 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
38 | isa = PBXContainerItemProxy;
39 | containerPortal = 6003F582195388D10070C39A /* Project object */;
40 | proxyType = 1;
41 | remoteGlobalIDString = 6003F589195388D20070C39A;
42 | remoteInfo = WeChatQRCodeScanner;
43 | };
44 | /* End PBXContainerItemProxy section */
45 |
46 | /* Begin PBXFileReference section */
47 | 14959E830D7DD2C980082B9E /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; };
48 | 237A8163E79019AD93687C00 /* Pods-WeChatQRCodeScanner_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatQRCodeScanner_Tests.debug.xcconfig"; path = "Target Support Files/Pods-WeChatQRCodeScanner_Tests/Pods-WeChatQRCodeScanner_Tests.debug.xcconfig"; sourceTree = ""; };
49 | 3C1A249525E9D7E000FBAD94 /* KKImageScannerResultViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KKImageScannerResultViewController.h; sourceTree = ""; };
50 | 3C1A249625E9D7E000FBAD94 /* KKImageScannerResultViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KKImageScannerResultViewController.m; sourceTree = ""; };
51 | 3C1A249725E9D7E000FBAD94 /* KKImageScannerResultViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KKImageScannerResultViewController.xib; sourceTree = ""; };
52 | 3CB6578325CA42FA005E6951 /* KKQRCodeScannerController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KKQRCodeScannerController.h; sourceTree = ""; };
53 | 3CB6578425CA42FA005E6951 /* KKQRCodeScannerController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KKQRCodeScannerController.m; sourceTree = ""; };
54 | 3CB6578525CA42FA005E6951 /* KKQRCodeScannerController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KKQRCodeScannerController.xib; sourceTree = ""; };
55 | 3CCB206325E8EA1B00EA7F89 /* test1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = test1.png; sourceTree = ""; };
56 | 3CCB206F25E8F06D00EA7F89 /* test2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = test2.png; sourceTree = ""; };
57 | 3CCB207325E8F12300EA7F89 /* test3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = test3.png; sourceTree = ""; };
58 | 3D7BF3A4C5551C87D336F081 /* Pods_WeChatQRCodeScanner_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WeChatQRCodeScanner_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
59 | 4DC65C00D10997107E002145 /* Pods-WeChatQRCodeScanner_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatQRCodeScanner_Example.release.xcconfig"; path = "Target Support Files/Pods-WeChatQRCodeScanner_Example/Pods-WeChatQRCodeScanner_Example.release.xcconfig"; sourceTree = ""; };
60 | 6003F58A195388D20070C39A /* WeChatQRCodeScanner_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WeChatQRCodeScanner_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
61 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
62 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
63 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
64 | 6003F595195388D20070C39A /* WeChatQRCodeScanner-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WeChatQRCodeScanner-Info.plist"; sourceTree = ""; };
65 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
66 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
67 | 6003F59C195388D20070C39A /* KKAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KKAppDelegate.h; sourceTree = ""; };
68 | 6003F59D195388D20070C39A /* KKAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KKAppDelegate.m; sourceTree = ""; };
69 | 6003F5A5195388D20070C39A /* KKViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KKViewController.h; sourceTree = ""; };
70 | 6003F5A6195388D20070C39A /* KKViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KKViewController.m; sourceTree = ""; };
71 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
72 | 6003F5AE195388D20070C39A /* WeChatQRCodeScanner_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WeChatQRCodeScanner_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
73 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
74 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; };
75 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
76 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; };
77 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; };
78 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
79 | 842B24A9787C91A5AC5EE91E /* Pods-WeChatQRCodeScanner_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatQRCodeScanner_Tests.release.xcconfig"; path = "Target Support Files/Pods-WeChatQRCodeScanner_Tests/Pods-WeChatQRCodeScanner_Tests.release.xcconfig"; sourceTree = ""; };
80 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; };
81 | B678BADF53590B288CBE546A /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; };
82 | C5DA69645CF897545CF45E25 /* Pods-WeChatQRCodeScanner_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatQRCodeScanner_Example.debug.xcconfig"; path = "Target Support Files/Pods-WeChatQRCodeScanner_Example/Pods-WeChatQRCodeScanner_Example.debug.xcconfig"; sourceTree = ""; };
83 | C5F476E4A70354F84B1FE87E /* WeChatQRCodeScanner.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = WeChatQRCodeScanner.podspec; path = ../WeChatQRCodeScanner.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
84 | FB69AD31953BBA5C1CD8E4B7 /* Pods_WeChatQRCodeScanner_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WeChatQRCodeScanner_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
85 | /* End PBXFileReference section */
86 |
87 | /* Begin PBXFrameworksBuildPhase section */
88 | 6003F587195388D20070C39A /* Frameworks */ = {
89 | isa = PBXFrameworksBuildPhase;
90 | buildActionMask = 2147483647;
91 | files = (
92 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
93 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
94 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
95 | 3454AD95E21E326BA76CB677 /* Pods_WeChatQRCodeScanner_Example.framework in Frameworks */,
96 | );
97 | runOnlyForDeploymentPostprocessing = 0;
98 | };
99 | 6003F5AB195388D20070C39A /* Frameworks */ = {
100 | isa = PBXFrameworksBuildPhase;
101 | buildActionMask = 2147483647;
102 | files = (
103 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
104 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
105 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
106 | 490AB707747EDE447E7F63FB /* Pods_WeChatQRCodeScanner_Tests.framework in Frameworks */,
107 | );
108 | runOnlyForDeploymentPostprocessing = 0;
109 | };
110 | /* End PBXFrameworksBuildPhase section */
111 |
112 | /* Begin PBXGroup section */
113 | 16B9E2BED5A2B3D09686962D /* Pods */ = {
114 | isa = PBXGroup;
115 | children = (
116 | C5DA69645CF897545CF45E25 /* Pods-WeChatQRCodeScanner_Example.debug.xcconfig */,
117 | 4DC65C00D10997107E002145 /* Pods-WeChatQRCodeScanner_Example.release.xcconfig */,
118 | 237A8163E79019AD93687C00 /* Pods-WeChatQRCodeScanner_Tests.debug.xcconfig */,
119 | 842B24A9787C91A5AC5EE91E /* Pods-WeChatQRCodeScanner_Tests.release.xcconfig */,
120 | );
121 | path = Pods;
122 | sourceTree = "";
123 | };
124 | 6003F581195388D10070C39A = {
125 | isa = PBXGroup;
126 | children = (
127 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
128 | 6003F593195388D20070C39A /* Example for WeChatQRCodeScanner */,
129 | 6003F5B5195388D20070C39A /* Tests */,
130 | 6003F58C195388D20070C39A /* Frameworks */,
131 | 6003F58B195388D20070C39A /* Products */,
132 | 16B9E2BED5A2B3D09686962D /* Pods */,
133 | );
134 | sourceTree = "";
135 | };
136 | 6003F58B195388D20070C39A /* Products */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 6003F58A195388D20070C39A /* WeChatQRCodeScanner_Example.app */,
140 | 6003F5AE195388D20070C39A /* WeChatQRCodeScanner_Tests.xctest */,
141 | );
142 | name = Products;
143 | sourceTree = "";
144 | };
145 | 6003F58C195388D20070C39A /* Frameworks */ = {
146 | isa = PBXGroup;
147 | children = (
148 | 6003F58D195388D20070C39A /* Foundation.framework */,
149 | 6003F58F195388D20070C39A /* CoreGraphics.framework */,
150 | 6003F591195388D20070C39A /* UIKit.framework */,
151 | 6003F5AF195388D20070C39A /* XCTest.framework */,
152 | FB69AD31953BBA5C1CD8E4B7 /* Pods_WeChatQRCodeScanner_Example.framework */,
153 | 3D7BF3A4C5551C87D336F081 /* Pods_WeChatQRCodeScanner_Tests.framework */,
154 | );
155 | name = Frameworks;
156 | sourceTree = "";
157 | };
158 | 6003F593195388D20070C39A /* Example for WeChatQRCodeScanner */ = {
159 | isa = PBXGroup;
160 | children = (
161 | 3CCB206325E8EA1B00EA7F89 /* test1.png */,
162 | 3CCB206F25E8F06D00EA7F89 /* test2.png */,
163 | 3CCB207325E8F12300EA7F89 /* test3.png */,
164 | 6003F59C195388D20070C39A /* KKAppDelegate.h */,
165 | 6003F59D195388D20070C39A /* KKAppDelegate.m */,
166 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
167 | 6003F5A5195388D20070C39A /* KKViewController.h */,
168 | 6003F5A6195388D20070C39A /* KKViewController.m */,
169 | 3C1A249525E9D7E000FBAD94 /* KKImageScannerResultViewController.h */,
170 | 3C1A249625E9D7E000FBAD94 /* KKImageScannerResultViewController.m */,
171 | 3C1A249725E9D7E000FBAD94 /* KKImageScannerResultViewController.xib */,
172 | 3CB6578325CA42FA005E6951 /* KKQRCodeScannerController.h */,
173 | 3CB6578425CA42FA005E6951 /* KKQRCodeScannerController.m */,
174 | 3CB6578525CA42FA005E6951 /* KKQRCodeScannerController.xib */,
175 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
176 | 6003F5A8195388D20070C39A /* Images.xcassets */,
177 | 6003F594195388D20070C39A /* Supporting Files */,
178 | );
179 | name = "Example for WeChatQRCodeScanner";
180 | path = WeChatQRCodeScanner;
181 | sourceTree = "";
182 | };
183 | 6003F594195388D20070C39A /* Supporting Files */ = {
184 | isa = PBXGroup;
185 | children = (
186 | 6003F595195388D20070C39A /* WeChatQRCodeScanner-Info.plist */,
187 | 6003F596195388D20070C39A /* InfoPlist.strings */,
188 | 6003F599195388D20070C39A /* main.m */,
189 | );
190 | name = "Supporting Files";
191 | sourceTree = "";
192 | };
193 | 6003F5B5195388D20070C39A /* Tests */ = {
194 | isa = PBXGroup;
195 | children = (
196 | 6003F5BB195388D20070C39A /* Tests.m */,
197 | 6003F5B6195388D20070C39A /* Supporting Files */,
198 | );
199 | path = Tests;
200 | sourceTree = "";
201 | };
202 | 6003F5B6195388D20070C39A /* Supporting Files */ = {
203 | isa = PBXGroup;
204 | children = (
205 | 6003F5B7195388D20070C39A /* Tests-Info.plist */,
206 | 6003F5B8195388D20070C39A /* InfoPlist.strings */,
207 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
208 | );
209 | name = "Supporting Files";
210 | sourceTree = "";
211 | };
212 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
213 | isa = PBXGroup;
214 | children = (
215 | C5F476E4A70354F84B1FE87E /* WeChatQRCodeScanner.podspec */,
216 | 14959E830D7DD2C980082B9E /* README.md */,
217 | B678BADF53590B288CBE546A /* LICENSE */,
218 | );
219 | name = "Podspec Metadata";
220 | sourceTree = "";
221 | };
222 | /* End PBXGroup section */
223 |
224 | /* Begin PBXNativeTarget section */
225 | 6003F589195388D20070C39A /* WeChatQRCodeScanner_Example */ = {
226 | isa = PBXNativeTarget;
227 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "WeChatQRCodeScanner_Example" */;
228 | buildPhases = (
229 | AD7076C913C765045BFA03B3 /* [CP] Check Pods Manifest.lock */,
230 | 6003F586195388D20070C39A /* Sources */,
231 | 6003F587195388D20070C39A /* Frameworks */,
232 | 6003F588195388D20070C39A /* Resources */,
233 | 4144C5F51B0F07095C70F954 /* [CP] Embed Pods Frameworks */,
234 | );
235 | buildRules = (
236 | );
237 | dependencies = (
238 | );
239 | name = WeChatQRCodeScanner_Example;
240 | productName = WeChatQRCodeScanner;
241 | productReference = 6003F58A195388D20070C39A /* WeChatQRCodeScanner_Example.app */;
242 | productType = "com.apple.product-type.application";
243 | };
244 | 6003F5AD195388D20070C39A /* WeChatQRCodeScanner_Tests */ = {
245 | isa = PBXNativeTarget;
246 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "WeChatQRCodeScanner_Tests" */;
247 | buildPhases = (
248 | 96AA55CD41A598714CB02619 /* [CP] Check Pods Manifest.lock */,
249 | 6003F5AA195388D20070C39A /* Sources */,
250 | 6003F5AB195388D20070C39A /* Frameworks */,
251 | 6003F5AC195388D20070C39A /* Resources */,
252 | );
253 | buildRules = (
254 | );
255 | dependencies = (
256 | 6003F5B4195388D20070C39A /* PBXTargetDependency */,
257 | );
258 | name = WeChatQRCodeScanner_Tests;
259 | productName = WeChatQRCodeScannerTests;
260 | productReference = 6003F5AE195388D20070C39A /* WeChatQRCodeScanner_Tests.xctest */;
261 | productType = "com.apple.product-type.bundle.unit-test";
262 | };
263 | /* End PBXNativeTarget section */
264 |
265 | /* Begin PBXProject section */
266 | 6003F582195388D10070C39A /* Project object */ = {
267 | isa = PBXProject;
268 | attributes = {
269 | CLASSPREFIX = KK;
270 | LastUpgradeCheck = 1240;
271 | ORGANIZATIONNAME = 0x1306a94;
272 | TargetAttributes = {
273 | 6003F589195388D20070C39A = {
274 | DevelopmentTeam = 492U995837;
275 | ProvisioningStyle = Manual;
276 | };
277 | 6003F5AD195388D20070C39A = {
278 | TestTargetID = 6003F589195388D20070C39A;
279 | };
280 | };
281 | };
282 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "WeChatQRCodeScanner" */;
283 | compatibilityVersion = "Xcode 3.2";
284 | developmentRegion = en;
285 | hasScannedForEncodings = 0;
286 | knownRegions = (
287 | en,
288 | Base,
289 | );
290 | mainGroup = 6003F581195388D10070C39A;
291 | productRefGroup = 6003F58B195388D20070C39A /* Products */;
292 | projectDirPath = "";
293 | projectRoot = "";
294 | targets = (
295 | 6003F589195388D20070C39A /* WeChatQRCodeScanner_Example */,
296 | 6003F5AD195388D20070C39A /* WeChatQRCodeScanner_Tests */,
297 | );
298 | };
299 | /* End PBXProject section */
300 |
301 | /* Begin PBXResourcesBuildPhase section */
302 | 6003F588195388D20070C39A /* Resources */ = {
303 | isa = PBXResourcesBuildPhase;
304 | buildActionMask = 2147483647;
305 | files = (
306 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
307 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
308 | 3CCB207025E8F06D00EA7F89 /* test2.png in Resources */,
309 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
310 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
311 | 3CB6578725CA42FA005E6951 /* KKQRCodeScannerController.xib in Resources */,
312 | 3CCB206425E8EA1B00EA7F89 /* test1.png in Resources */,
313 | 3C1A249925E9D7E000FBAD94 /* KKImageScannerResultViewController.xib in Resources */,
314 | 3CCB207425E8F12300EA7F89 /* test3.png in Resources */,
315 | );
316 | runOnlyForDeploymentPostprocessing = 0;
317 | };
318 | 6003F5AC195388D20070C39A /* Resources */ = {
319 | isa = PBXResourcesBuildPhase;
320 | buildActionMask = 2147483647;
321 | files = (
322 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
323 | );
324 | runOnlyForDeploymentPostprocessing = 0;
325 | };
326 | /* End PBXResourcesBuildPhase section */
327 |
328 | /* Begin PBXShellScriptBuildPhase section */
329 | 4144C5F51B0F07095C70F954 /* [CP] Embed Pods Frameworks */ = {
330 | isa = PBXShellScriptBuildPhase;
331 | buildActionMask = 2147483647;
332 | files = (
333 | );
334 | inputPaths = (
335 | "${PODS_ROOT}/Target Support Files/Pods-WeChatQRCodeScanner_Example/Pods-WeChatQRCodeScanner_Example-frameworks.sh",
336 | "${BUILT_PRODUCTS_DIR}/WeChatQRCodeScanner/WeChatQRCodeScanner.framework",
337 | );
338 | name = "[CP] Embed Pods Frameworks";
339 | outputPaths = (
340 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WeChatQRCodeScanner.framework",
341 | );
342 | runOnlyForDeploymentPostprocessing = 0;
343 | shellPath = /bin/sh;
344 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WeChatQRCodeScanner_Example/Pods-WeChatQRCodeScanner_Example-frameworks.sh\"\n";
345 | showEnvVarsInLog = 0;
346 | };
347 | 96AA55CD41A598714CB02619 /* [CP] Check Pods Manifest.lock */ = {
348 | isa = PBXShellScriptBuildPhase;
349 | buildActionMask = 2147483647;
350 | files = (
351 | );
352 | inputFileListPaths = (
353 | );
354 | inputPaths = (
355 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
356 | "${PODS_ROOT}/Manifest.lock",
357 | );
358 | name = "[CP] Check Pods Manifest.lock";
359 | outputFileListPaths = (
360 | );
361 | outputPaths = (
362 | "$(DERIVED_FILE_DIR)/Pods-WeChatQRCodeScanner_Tests-checkManifestLockResult.txt",
363 | );
364 | runOnlyForDeploymentPostprocessing = 0;
365 | shellPath = /bin/sh;
366 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
367 | showEnvVarsInLog = 0;
368 | };
369 | AD7076C913C765045BFA03B3 /* [CP] Check Pods Manifest.lock */ = {
370 | isa = PBXShellScriptBuildPhase;
371 | buildActionMask = 2147483647;
372 | files = (
373 | );
374 | inputFileListPaths = (
375 | );
376 | inputPaths = (
377 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
378 | "${PODS_ROOT}/Manifest.lock",
379 | );
380 | name = "[CP] Check Pods Manifest.lock";
381 | outputFileListPaths = (
382 | );
383 | outputPaths = (
384 | "$(DERIVED_FILE_DIR)/Pods-WeChatQRCodeScanner_Example-checkManifestLockResult.txt",
385 | );
386 | runOnlyForDeploymentPostprocessing = 0;
387 | shellPath = /bin/sh;
388 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
389 | showEnvVarsInLog = 0;
390 | };
391 | /* End PBXShellScriptBuildPhase section */
392 |
393 | /* Begin PBXSourcesBuildPhase section */
394 | 6003F586195388D20070C39A /* Sources */ = {
395 | isa = PBXSourcesBuildPhase;
396 | buildActionMask = 2147483647;
397 | files = (
398 | 3CB6578625CA42FA005E6951 /* KKQRCodeScannerController.m in Sources */,
399 | 6003F59E195388D20070C39A /* KKAppDelegate.m in Sources */,
400 | 6003F5A7195388D20070C39A /* KKViewController.m in Sources */,
401 | 6003F59A195388D20070C39A /* main.m in Sources */,
402 | 3C1A249825E9D7E000FBAD94 /* KKImageScannerResultViewController.m in Sources */,
403 | );
404 | runOnlyForDeploymentPostprocessing = 0;
405 | };
406 | 6003F5AA195388D20070C39A /* Sources */ = {
407 | isa = PBXSourcesBuildPhase;
408 | buildActionMask = 2147483647;
409 | files = (
410 | 6003F5BC195388D20070C39A /* Tests.m in Sources */,
411 | );
412 | runOnlyForDeploymentPostprocessing = 0;
413 | };
414 | /* End PBXSourcesBuildPhase section */
415 |
416 | /* Begin PBXTargetDependency section */
417 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
418 | isa = PBXTargetDependency;
419 | target = 6003F589195388D20070C39A /* WeChatQRCodeScanner_Example */;
420 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
421 | };
422 | /* End PBXTargetDependency section */
423 |
424 | /* Begin PBXVariantGroup section */
425 | 6003F596195388D20070C39A /* InfoPlist.strings */ = {
426 | isa = PBXVariantGroup;
427 | children = (
428 | 6003F597195388D20070C39A /* en */,
429 | );
430 | name = InfoPlist.strings;
431 | sourceTree = "";
432 | };
433 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
434 | isa = PBXVariantGroup;
435 | children = (
436 | 6003F5B9195388D20070C39A /* en */,
437 | );
438 | name = InfoPlist.strings;
439 | sourceTree = "";
440 | };
441 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
442 | isa = PBXVariantGroup;
443 | children = (
444 | 71719F9E1E33DC2100824A3D /* Base */,
445 | );
446 | name = LaunchScreen.storyboard;
447 | sourceTree = "";
448 | };
449 | /* End PBXVariantGroup section */
450 |
451 | /* Begin XCBuildConfiguration section */
452 | 6003F5BD195388D20070C39A /* Debug */ = {
453 | isa = XCBuildConfiguration;
454 | buildSettings = {
455 | ALWAYS_SEARCH_USER_PATHS = NO;
456 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
457 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
458 | CLANG_CXX_LIBRARY = "libc++";
459 | CLANG_ENABLE_MODULES = YES;
460 | CLANG_ENABLE_OBJC_ARC = YES;
461 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
462 | CLANG_WARN_BOOL_CONVERSION = YES;
463 | CLANG_WARN_COMMA = YES;
464 | CLANG_WARN_CONSTANT_CONVERSION = YES;
465 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
466 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
467 | CLANG_WARN_EMPTY_BODY = YES;
468 | CLANG_WARN_ENUM_CONVERSION = YES;
469 | CLANG_WARN_INFINITE_RECURSION = YES;
470 | CLANG_WARN_INT_CONVERSION = YES;
471 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
472 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
473 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
474 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
475 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
476 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
477 | CLANG_WARN_STRICT_PROTOTYPES = YES;
478 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
479 | CLANG_WARN_UNREACHABLE_CODE = YES;
480 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
481 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
482 | COPY_PHASE_STRIP = NO;
483 | ENABLE_STRICT_OBJC_MSGSEND = YES;
484 | ENABLE_TESTABILITY = YES;
485 | GCC_C_LANGUAGE_STANDARD = gnu99;
486 | GCC_DYNAMIC_NO_PIC = NO;
487 | GCC_NO_COMMON_BLOCKS = YES;
488 | GCC_OPTIMIZATION_LEVEL = 0;
489 | GCC_PREPROCESSOR_DEFINITIONS = (
490 | "DEBUG=1",
491 | "$(inherited)",
492 | );
493 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
494 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
495 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
496 | GCC_WARN_UNDECLARED_SELECTOR = YES;
497 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
498 | GCC_WARN_UNUSED_FUNCTION = YES;
499 | GCC_WARN_UNUSED_VARIABLE = YES;
500 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
501 | ONLY_ACTIVE_ARCH = YES;
502 | SDKROOT = iphoneos;
503 | TARGETED_DEVICE_FAMILY = "1,2";
504 | };
505 | name = Debug;
506 | };
507 | 6003F5BE195388D20070C39A /* Release */ = {
508 | isa = XCBuildConfiguration;
509 | buildSettings = {
510 | ALWAYS_SEARCH_USER_PATHS = NO;
511 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
512 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
513 | CLANG_CXX_LIBRARY = "libc++";
514 | CLANG_ENABLE_MODULES = YES;
515 | CLANG_ENABLE_OBJC_ARC = YES;
516 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
517 | CLANG_WARN_BOOL_CONVERSION = YES;
518 | CLANG_WARN_COMMA = YES;
519 | CLANG_WARN_CONSTANT_CONVERSION = YES;
520 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
521 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
522 | CLANG_WARN_EMPTY_BODY = YES;
523 | CLANG_WARN_ENUM_CONVERSION = YES;
524 | CLANG_WARN_INFINITE_RECURSION = YES;
525 | CLANG_WARN_INT_CONVERSION = YES;
526 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
527 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
528 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
529 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
530 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
531 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
532 | CLANG_WARN_STRICT_PROTOTYPES = YES;
533 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
534 | CLANG_WARN_UNREACHABLE_CODE = YES;
535 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
536 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
537 | COPY_PHASE_STRIP = YES;
538 | ENABLE_NS_ASSERTIONS = NO;
539 | ENABLE_STRICT_OBJC_MSGSEND = YES;
540 | GCC_C_LANGUAGE_STANDARD = gnu99;
541 | GCC_NO_COMMON_BLOCKS = YES;
542 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
543 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
544 | GCC_WARN_UNDECLARED_SELECTOR = YES;
545 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
546 | GCC_WARN_UNUSED_FUNCTION = YES;
547 | GCC_WARN_UNUSED_VARIABLE = YES;
548 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
549 | SDKROOT = iphoneos;
550 | TARGETED_DEVICE_FAMILY = "1,2";
551 | VALIDATE_PRODUCT = YES;
552 | };
553 | name = Release;
554 | };
555 | 6003F5C0195388D20070C39A /* Debug */ = {
556 | isa = XCBuildConfiguration;
557 | baseConfigurationReference = C5DA69645CF897545CF45E25 /* Pods-WeChatQRCodeScanner_Example.debug.xcconfig */;
558 | buildSettings = {
559 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
560 | CODE_SIGN_STYLE = Manual;
561 | DEVELOPMENT_TEAM = 492U995837;
562 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
563 | GCC_PREFIX_HEADER = "";
564 | INFOPLIST_FILE = "WeChatQRCodeScanner/WeChatQRCodeScanner-Info.plist";
565 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
566 | MODULE_NAME = ExampleApp;
567 | PRODUCT_BUNDLE_IDENTIFIER = "com.taihe.WeChatQRCodeScanner-Example";
568 | PRODUCT_NAME = "$(TARGET_NAME)";
569 | PROVISIONING_PROFILE_SPECIFIER = "match Development com.taihe.*";
570 | SWIFT_VERSION = 4.0;
571 | WRAPPER_EXTENSION = app;
572 | };
573 | name = Debug;
574 | };
575 | 6003F5C1195388D20070C39A /* Release */ = {
576 | isa = XCBuildConfiguration;
577 | baseConfigurationReference = 4DC65C00D10997107E002145 /* Pods-WeChatQRCodeScanner_Example.release.xcconfig */;
578 | buildSettings = {
579 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
580 | CODE_SIGN_IDENTITY = "iPhone Distribution";
581 | CODE_SIGN_STYLE = Manual;
582 | DEVELOPMENT_TEAM = 492U995837;
583 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
584 | GCC_PREFIX_HEADER = "";
585 | INFOPLIST_FILE = "WeChatQRCodeScanner/WeChatQRCodeScanner-Info.plist";
586 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
587 | MODULE_NAME = ExampleApp;
588 | PRODUCT_BUNDLE_IDENTIFIER = "com.taihe.WeChatQRCodeScanner-Example";
589 | PRODUCT_NAME = "$(TARGET_NAME)";
590 | PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.taihe.*";
591 | SWIFT_VERSION = 4.0;
592 | WRAPPER_EXTENSION = app;
593 | };
594 | name = Release;
595 | };
596 | 6003F5C3195388D20070C39A /* Debug */ = {
597 | isa = XCBuildConfiguration;
598 | baseConfigurationReference = 237A8163E79019AD93687C00 /* Pods-WeChatQRCodeScanner_Tests.debug.xcconfig */;
599 | buildSettings = {
600 | BUNDLE_LOADER = "$(TEST_HOST)";
601 | FRAMEWORK_SEARCH_PATHS = (
602 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
603 | "$(inherited)",
604 | "$(DEVELOPER_FRAMEWORKS_DIR)",
605 | );
606 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
607 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
608 | GCC_PREPROCESSOR_DEFINITIONS = (
609 | "DEBUG=1",
610 | "$(inherited)",
611 | );
612 | INFOPLIST_FILE = "Tests/Tests-Info.plist";
613 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
614 | PRODUCT_NAME = "$(TARGET_NAME)";
615 | SWIFT_VERSION = 4.0;
616 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WeChatQRCodeScanner_Example.app/WeChatQRCodeScanner_Example";
617 | WRAPPER_EXTENSION = xctest;
618 | };
619 | name = Debug;
620 | };
621 | 6003F5C4195388D20070C39A /* Release */ = {
622 | isa = XCBuildConfiguration;
623 | baseConfigurationReference = 842B24A9787C91A5AC5EE91E /* Pods-WeChatQRCodeScanner_Tests.release.xcconfig */;
624 | buildSettings = {
625 | BUNDLE_LOADER = "$(TEST_HOST)";
626 | FRAMEWORK_SEARCH_PATHS = (
627 | "$(PLATFORM_DIR)/Developer/Library/Frameworks",
628 | "$(inherited)",
629 | "$(DEVELOPER_FRAMEWORKS_DIR)",
630 | );
631 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
632 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
633 | INFOPLIST_FILE = "Tests/Tests-Info.plist";
634 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
635 | PRODUCT_NAME = "$(TARGET_NAME)";
636 | SWIFT_VERSION = 4.0;
637 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WeChatQRCodeScanner_Example.app/WeChatQRCodeScanner_Example";
638 | WRAPPER_EXTENSION = xctest;
639 | };
640 | name = Release;
641 | };
642 | /* End XCBuildConfiguration section */
643 |
644 | /* Begin XCConfigurationList section */
645 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "WeChatQRCodeScanner" */ = {
646 | isa = XCConfigurationList;
647 | buildConfigurations = (
648 | 6003F5BD195388D20070C39A /* Debug */,
649 | 6003F5BE195388D20070C39A /* Release */,
650 | );
651 | defaultConfigurationIsVisible = 0;
652 | defaultConfigurationName = Release;
653 | };
654 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "WeChatQRCodeScanner_Example" */ = {
655 | isa = XCConfigurationList;
656 | buildConfigurations = (
657 | 6003F5C0195388D20070C39A /* Debug */,
658 | 6003F5C1195388D20070C39A /* Release */,
659 | );
660 | defaultConfigurationIsVisible = 0;
661 | defaultConfigurationName = Release;
662 | };
663 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "WeChatQRCodeScanner_Tests" */ = {
664 | isa = XCConfigurationList;
665 | buildConfigurations = (
666 | 6003F5C3195388D20070C39A /* Debug */,
667 | 6003F5C4195388D20070C39A /* Release */,
668 | );
669 | defaultConfigurationIsVisible = 0;
670 | defaultConfigurationName = Release;
671 | };
672 | /* End XCConfigurationList section */
673 | };
674 | rootObject = 6003F582195388D10070C39A /* Project object */;
675 | }
676 |
--------------------------------------------------------------------------------