├── images
└── 123.gif
├── 自定义相机
├── 自定义相机
│ ├── libs
│ │ ├── IQEngUICamera.bundle
│ │ │ ├── IQEngUICameraScanLine@2x.png
│ │ │ ├── IQEngUICameraScanLine@3x.png
│ │ │ ├── IQEngUICameraScanscanBg.png
│ │ │ ├── IQEngUICamera_img_camera.png
│ │ │ ├── IQEngUICameraTakePhoto@2x.png
│ │ │ ├── IQEngUICamera_btn_arrows_back.png
│ │ │ └── IQEngUICamera_imag_scan_background.png
│ │ ├── NSBundle+IQEngUICamera.h
│ │ ├── IQEngUIQRCodeView.h
│ │ ├── UIImage+IQEngUICamera.h
│ │ ├── IQEngUIPhotoSessionView.h
│ │ ├── NSBundle+IQEngUICamera.m
│ │ ├── IQEngUIQRCodeSessionView.h
│ │ ├── UIImage+IQEngUICamera.m
│ │ ├── IQEngUIPhotoSessionView.m
│ │ ├── IQEngUIQRCodeSessionView.m
│ │ ├── IQEngUIQRCodeView.m
│ │ ├── IQEngUIAVCaptureSessionView_base.m
│ │ └── IQEngUIAVCaptureSessionView_base.h
│ ├── ViewController.h
│ ├── IQEngUIBackGroundView.h
│ ├── _____.xcdatamodeld
│ │ └── _____.xcdatamodel
│ │ │ └── contents
│ ├── main.m
│ ├── IQEngUIPhotoViewController.h
│ ├── IQEngUIFaceViewController.h
│ ├── IQEngUIQRCodeViewController.h
│ ├── UIView+IQEngUICamera.h
│ ├── AppDelegate.h
│ ├── IQEngUIIDCardScanViewController.h
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── UIView+IQEngUICamera.m
│ ├── IQEngUIBackGroundView.m
│ ├── Info.plist
│ ├── IQEngUIQRCodeViewController.m
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ ├── IQEngUIPhotoViewController.m
│ ├── IQEngUIFaceViewController.m
│ ├── ViewController.m
│ ├── AppDelegate.m
│ └── IQEngUIIDCardScanViewController.m
├── 自定义相机.xcodeproj
│ ├── xcuserdata
│ │ └── Herson.xcuserdatad
│ │ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── 自定义相机.xcscheme
│ ├── project.xcworkspace
│ │ ├── xcuserdata
│ │ │ └── Herson.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
└── 自定义相机UITests
│ ├── Info.plist
│ └── _____UITests.m
├── README.md
└── .gitignore
/images/123.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/images/123.gif
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanLine@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanLine@2x.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanLine@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanLine@3x.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanscanBg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraScanscanBg.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_img_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_img_camera.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraTakePhoto@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICameraTakePhoto@2x.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/xcuserdata/Herson.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_btn_arrows_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_btn_arrows_back.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_imag_scan_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机/libs/IQEngUICamera.bundle/IQEngUICamera_imag_scan_background.png
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/project.xcworkspace/xcuserdata/Herson.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HansenCCC/IQEngUICamera/master/自定义相机/自定义相机.xcodeproj/project.xcworkspace/xcuserdata/Herson.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IQEngUICamera
2 | 自定义相机、二维码扫描、人脸追踪、自定义身份证证件照
3 | 缘故:系统相机跟需求有点不一样,需要自定义相机。一顿百度谷歌之后,总结了出了这个dome。若想自定义相机,只需集成我的相机基类,避开系统设置繁琐代码,轻松搞定。
4 |
5 | ![image] (https://raw.githubusercontent.com/HersonIQ/IQEngUICamera/master/images/123.gif)
6 |
7 | 娱人愚己,自娱自乐。 i'm here https://www.zhihu.com/people/EngCCC
8 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIBackGroundView.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIBackGroundView.h
3 | // IQEngIDCard
4 | //
5 | // Created by 程恒盛 on 17/3/14.
6 | // Copyright © 2017年 力王. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IQEngUIBackGroundView : UIView
12 | @property(nonatomic, assign) CGRect transparentFrame;
13 | @end
14 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/NSBundle+IQEngUICamera.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+IQEngUICamera.h
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/30.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSBundle (IQEngUICamera)
12 | +(instancetype)bundleForIQEngUICamera;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/_____.xcdatamodeld/_____.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. 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 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIQRCodeView.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeView.h
3 | // 自定义相机
4 | // 二维码扫描视图(中间透明)
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IQEngUIQRCodeView : UIView
12 | //设置显示框rect
13 | @property(nonatomic, assign) CGRect maskViewFrame;
14 |
15 | @end
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIPhotoViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIPhotoViewController.h
3 | // 自定义相机
4 | // 相机例子
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "IQEngUIPhotoSessionView.h"
11 | @interface IQEngUIPhotoViewController : UIViewController
12 | @property(nonatomic, strong) IQEngUIPhotoSessionView *sessionView;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIFaceViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIFaceViewController.h
3 | // 自定义相机
4 | // 人脸识别例子
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "IQEngUIQRCodeSessionView.h"
11 |
12 | @interface IQEngUIFaceViewController : UIViewController
13 | @property(nonatomic, strong) IQEngUIQRCodeSessionView *sessionView;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIQRCodeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeViewController.h
3 | // 自定义相机
4 | // 二维码扫描例子
5 | // Created by 力王 on 16/11/22.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "IQEngUIQRCodeSessionView.h"
11 |
12 | @interface IQEngUIQRCodeViewController : UIViewController
13 | @property(nonatomic, strong) IQEngUIQRCodeSessionView *sessionView;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/UIView+IQEngUICamera.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+IQEngUICamera.h
3 | // IQEngIDCard
4 | //
5 | // Created by 程恒盛 on 17/3/13.
6 | // Copyright © 2017年 力王. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIView (IQEngUICamera)
12 | /**
13 | * 自动根据当前设备的朝向,设置self.transform值
14 | *
15 | * @param animted 是否动画,默认的动画时间为0.25秒
16 | */
17 | - (void)setTransformThatFitDeviceOrientation:(UIDeviceOrientation)orientation animated:(BOOL)animted;
18 | @end
19 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong) NSPersistentContainer *persistentContainer;
17 |
18 | - (void)saveContext;
19 |
20 |
21 | @end
22 |
23 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/UIImage+IQEngUICamera.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+IQEngUICamera.h
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/30.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "NSBundle+IQEngUICamera.h"
11 | @interface UIImage (IQEngUICamera)
12 | + (UIImage *)imageNamed_IQEngUICamera:(NSString *)name;
13 | +(UIImage*)image:(UIImage *)image scaleToSize:(CGSize)size;
14 | +(UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIPhotoSessionView.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIPhotoSessionView.h
3 | // 自定义相机
4 | // 拍照
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIAVCaptureSessionView_base.h"
10 |
11 | @interface IQEngUIPhotoSessionView : IQEngUIAVCaptureSessionView_base
12 | //完成拍照回调
13 | @property(nonatomic, strong) void (^whenTakePhoto) (UIImage *photo);
14 |
15 | /**
16 | * 拍照
17 | */
18 | -(void)takePhoto;
19 | @end
20 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/NSBundle+IQEngUICamera.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+IQEngUICamera.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/30.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "NSBundle+IQEngUICamera.h"
10 |
11 | @implementation NSBundle (IQEngUICamera)
12 |
13 | +(instancetype)bundleForIQEngUICamera{
14 |
15 | NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"IQEngUICamera" ofType:@"bundle"]];
16 | return bundle;
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIIDCardScanViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIIDCardScanViewController.h
3 | // 自定义相机
4 | // 相机例子
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "IQEngUIPhotoSessionView.h"
11 |
12 | @interface IQEngUIIDCardScanViewController : UIViewController
13 | @property(nonatomic, strong) IQEngUIPhotoSessionView *sessionView;
14 | //截取的尺寸
15 | @property(nonatomic, readonly) CGRect effectiveRect;
16 | //是否写入本地
17 | @property (nonatomic, assign) BOOL shouldWriteToSavedPhotos;
18 |
19 | @property(nonatomic, strong) void (^whenFinsh)(UIImage *);
20 | @end
21 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/xcuserdata/Herson.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | 自定义相机.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 308063361DDD59C500D8C2F4
16 |
17 | primary
18 |
19 |
20 | 308063521DDD59C500D8C2F4
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机UITests/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 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/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 | }
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIQRCodeSessionView.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeSessionView.h
3 | // 自定义相机
4 | // 二维码扫描&人脸识别
5 | // Created by 力王 on 16/11/21.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIAVCaptureSessionView_base.h"
10 |
11 | typedef enum : NSUInteger {
12 | IQEngMetadataObjectTypeQR = 0,//二维码
13 | IQEngMetadataObjectTypeFace,//人脸
14 | } IQEngMetadataObjectType;
15 |
16 | @protocol IQEngUIQRCodeSessionViewDelegate
17 | -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection;//识别成功回调
18 | @end
19 |
20 | @interface IQEngUIQRCodeSessionView : IQEngUIAVCaptureSessionView_base
21 | //输出图片
22 | //@property(nonatomic, strong) AVCaptureMetadataOutput *qrcCodeOutput;
23 | //扫描类型(默认人脸识别类型)
24 | @property(nonatomic, assign) IQEngMetadataObjectType type;
25 | //扫描成功后回调此方法
26 | @property(nonatomic, strong) void (^whenFinish) (AVMetadataObject *codeObject);
27 | //delegate
28 | @property(nonatomic, strong) id delegate;
29 | @end
30 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机UITests/_____UITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // _____UITests.m
3 | // 自定义相机UITests
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface _____UITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation _____UITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/UIView+IQEngUICamera.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+IQEngUICamera.m
3 | // IQEngIDCard
4 | //
5 | // Created by 程恒盛 on 17/3/13.
6 | // Copyright © 2017年 力王. All rights reserved.
7 | //
8 |
9 | #import "UIView+IQEngUICamera.h"
10 |
11 | @implementation UIView (IQEngUICamera)
12 | + (CGAffineTransform)transformWithDeviceOrientation:(UIDeviceOrientation)orientation{
13 | CGAffineTransform m = CGAffineTransformIdentity;
14 | switch (orientation) {
15 | case UIDeviceOrientationLandscapeLeft:
16 | m = CGAffineTransformMakeRotation(M_PI_2);
17 | break;
18 | case UIDeviceOrientationLandscapeRight:
19 | m = CGAffineTransformMakeRotation(-M_PI_2);
20 | break;
21 | case UIDeviceOrientationPortrait:
22 | break;
23 | case UIDeviceOrientationPortraitUpsideDown:
24 | m = CGAffineTransformMakeRotation(M_PI);
25 | break;
26 | default:
27 | break;
28 | }
29 | return m;
30 | }
31 | - (void)setTransformThatFitDeviceOrientation:(UIDeviceOrientation)orientation animated:(BOOL)animted{
32 | CGAffineTransform m = [self.class transformWithDeviceOrientation:orientation];
33 | if(animted){
34 | [UIView animateWithDuration:0.25 animations:^{
35 | self.transform = m;
36 | }];
37 | }else{
38 | self.transform = m;
39 | }
40 | }
41 | @end
42 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIBackGroundView.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIBackGroundView.m
3 | // IQEngIDCard
4 | //
5 | // Created by 程恒盛 on 17/3/14.
6 | // Copyright © 2017年 力王. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIBackGroundView.h"
10 |
11 | @interface IQEngUIBackGroundView ()
12 | @property(nonatomic, strong) UIView *maskView;//contentView
13 | @end
14 |
15 | @implementation IQEngUIBackGroundView
16 |
17 | -(void)drawRect:(CGRect)rect
18 | {
19 | [super drawRect:rect];
20 |
21 | CGRect f1 = self.transparentFrame;
22 | UIBezierPath *aPath = [UIBezierPath bezierPathWithRect:self.bounds];
23 | [aPath appendPath:[[UIBezierPath bezierPathWithRoundedRect:f1 cornerRadius:1] bezierPathByReversingPath]];
24 |
25 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
26 | maskLayer.path = aPath.CGPath;
27 | self.maskView.layer.mask = maskLayer;
28 | }
29 | -(instancetype)init{
30 | if (self = [super init]) {
31 | self.backgroundColor = [UIColor clearColor];
32 |
33 | self.maskView = [[UIView alloc] init];
34 | self.maskView.backgroundColor = [UIColor colorWithRed:10/255.0 green:10/255.0 blue:10/255.0 alpha:0.3];
35 | [self addSubview:self.maskView];
36 | }
37 | return self;
38 | }
39 | -(void)layoutSubviews{
40 | [super layoutSubviews];
41 |
42 | CGRect bounds = self.bounds;
43 | self.maskView.frame = bounds;
44 | }
45 | @end
46 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/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 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | NSCameraUsageDescription
24 | app need to
25 | NSPhotoLibraryUsageDescription
26 | app need to
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | # CocoaPods
31 | #
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
35 | #
36 | # Pods/
37 |
38 | # Carthage
39 | #
40 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
41 | # Carthage/Checkouts
42 |
43 | Carthage/Build
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/screenshots
54 |
55 | #Code Injection
56 | #
57 | # After new code Injection tools there's a generated folder /iOSInjectionProject
58 | # https://github.com/johnno1962/injectionforxcode
59 |
60 | iOSInjectionProject/
61 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/UIImage+IQEngUICamera.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+IQEngUICamera.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/30.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "UIImage+IQEngUICamera.h"
10 |
11 | @implementation UIImage (IQEngUICamera)
12 | + (UIImage *)imageNamed_IQEngUICamera:(NSString *)name{
13 |
14 | NSBundle *boundle = [NSBundle bundleForIQEngUICamera];
15 | UIImage *image = [self imageNamed:name inBundle:boundle compatibleWithTraitCollection:nil];
16 | return image;
17 | }
18 |
19 | /**
20 | *将图片缩放到指定的CGSize大小
21 | * UIImage image 原始的图片
22 | * CGSize size 要缩放到的大小
23 | */
24 | +(UIImage*)image:(UIImage *)image scaleToSize:(CGSize)size{
25 |
26 | // 得到图片上下文,指定绘制范围
27 | UIGraphicsBeginImageContext(size);
28 |
29 | // 将图片按照指定大小绘制
30 | [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
31 |
32 | // 从当前图片上下文中导出图片
33 | UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
34 |
35 | // 当前图片上下文出栈
36 | UIGraphicsEndImageContext();
37 |
38 | // 返回新的改变大小后的图片
39 | return scaledImage;
40 | }
41 |
42 | /**
43 | *从图片中按指定的位置大小截取图片的一部分
44 | * UIImage image 原始的图片
45 | * CGRect rect 要截取的区域
46 | */
47 | +(UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect{
48 |
49 | //将UIImage转换成CGImageRef
50 | CGImageRef sourceImageRef = [image CGImage];
51 |
52 | //按照给定的矩形区域进行剪裁
53 | CGImageRef newImageRef = CGImageCreateWithImageInRect(sourceImageRef, rect);
54 |
55 | //将CGImageRef转换成UIImage
56 | UIImage *newImage = [UIImage imageWithCGImage:newImageRef];
57 |
58 | //返回剪裁后的图片
59 | return newImage;
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIQRCodeViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeViewController.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/22.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIQRCodeViewController.h"
10 | #import "IQEngUIQRCodeView.h"
11 | @interface IQEngUIQRCodeViewController ()
12 | @property(nonatomic, strong) IQEngUIQRCodeView *qrCodeView;
13 |
14 | @end
15 |
16 | @implementation IQEngUIQRCodeViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | self.view.backgroundColor = [UIColor whiteColor];
21 | [self.sessionView startRunning];
22 |
23 | self.qrCodeView = [[IQEngUIQRCodeView alloc] init];
24 | [self.sessionView addSubview:self.qrCodeView];
25 | }
26 | -(void)viewWillLayoutSubviews{
27 | [super viewWillLayoutSubviews];
28 |
29 | CGRect bounds = self.view.bounds;
30 | self.sessionView.frame = bounds;
31 | self.qrCodeView.frame = bounds;
32 |
33 | CGRect f1 = bounds;
34 | f1.size = CGSizeMake(bounds.size.width*3/4, bounds.size.width*3/4);
35 | f1.origin.x = (bounds.size.width - f1.size.width)/2;
36 | f1.origin.y = (bounds.size.height - f1.size.height)/2;
37 | self.qrCodeView.maskViewFrame = f1;
38 |
39 | //设置扫描区域
40 | CGRect f2 = [self.sessionView.previewLayer metadataOutputRectOfInterestForRect:f1];
41 | ((AVCaptureMetadataOutput *)self.sessionView.output).rectOfInterest = f2;
42 | }
43 | #pragma mark - lazy load
44 | -(IQEngUIQRCodeSessionView *)sessionView{
45 | if (!_sessionView) {
46 | _sessionView = [[IQEngUIQRCodeSessionView alloc] init];
47 | _sessionView.showFocusView = NO;//取消点击对焦功能
48 | [self.view addSubview:_sessionView];
49 | }
50 | return _sessionView;
51 | }
52 | @end
53 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/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 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/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 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIPhotoViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIPhotoViewController.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIPhotoViewController.h"
10 | #import "UIImage+IQEngUICamera.h"
11 |
12 | @interface IQEngUIPhotoViewController ()
13 | @property(nonatomic, strong) UIButton *takePhotoButton;
14 |
15 | @end
16 |
17 | @implementation IQEngUIPhotoViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | self.view.backgroundColor = [UIColor whiteColor];
22 |
23 | self.sessionView.devicePosition = AVCaptureDevicePositionBack;
24 | [self.sessionView startRunning];
25 |
26 |
27 | self.takePhotoButton = [[UIButton alloc] init];
28 | [self.takePhotoButton setImage:[UIImage imageNamed_IQEngUICamera:@"IQEngUICameraTakePhoto.png"] forState:UIControlStateNormal];
29 | [self.takePhotoButton addTarget:self action:@selector(takePhoto) forControlEvents:UIControlEventTouchUpInside];
30 | [self.sessionView addSubview:self.takePhotoButton];
31 | }
32 |
33 | -(void)takePhoto{
34 | //拍照
35 | [self.sessionView takePhoto];
36 | }
37 |
38 | -(void)viewWillLayoutSubviews{
39 | [super viewWillLayoutSubviews];
40 |
41 | CGRect bounds = self.view.bounds;
42 | self.sessionView.frame = bounds;
43 |
44 | CGRect f1 = bounds;
45 | f1.size = CGSizeMake(65, 65);
46 | f1.origin.x = (bounds.size.width - f1.size.width)/2;
47 | f1.origin.y = bounds.size.height - f1.size.height - 20;
48 | self.takePhotoButton.frame = f1;
49 | }
50 | #pragma mark - lazy load
51 | -(IQEngUIPhotoSessionView *)sessionView{
52 | if (!_sessionView) {
53 | _sessionView = [[IQEngUIPhotoSessionView alloc] init];
54 | [self.view addSubview:_sessionView];
55 | }
56 | return _sessionView;
57 | }
58 | @end
59 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIFaceViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIFaceViewController.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIFaceViewController.h"
10 |
11 | @interface IQEngUIFaceViewController ()
12 | @property(nonatomic, strong) UIView *faceView;
13 |
14 | @end
15 |
16 | @implementation IQEngUIFaceViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 |
21 | self.view.backgroundColor = [UIColor whiteColor];
22 | [self.sessionView startRunning];
23 | self.sessionView.devicePosition = AVCaptureDevicePositionFront;
24 |
25 | self.faceView = [[UIView alloc] init];
26 | self.faceView.layer.borderWidth = 1;
27 | self.faceView.layer.borderColor = [UIColor yellowColor].CGColor;
28 | [self.sessionView addSubview:self.faceView];
29 | }
30 | -(void)viewWillLayoutSubviews{
31 | [super viewWillLayoutSubviews];
32 |
33 | CGRect bounds = self.view.bounds;
34 | self.sessionView.frame = bounds;
35 | }
36 | #pragma mark - lazy load
37 | -(IQEngUIQRCodeSessionView *)sessionView{
38 | if (!_sessionView) {
39 | _sessionView = [[IQEngUIQRCodeSessionView alloc] init];
40 | _sessionView.delegate = self;
41 | [self.view addSubview:_sessionView];
42 | }
43 | return _sessionView;
44 | }
45 | #pragma mark - IQEngUIQRCodeSessionViewDelegate
46 | -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection{
47 | //显示最大的脸
48 | CGRect f1 = CGRectZero;
49 | for (AVMetadataFaceObject *faceObject in metadataObjects) {
50 | CGRect f2 = [self.sessionView.previewLayer rectForMetadataOutputRectOfInterest:faceObject.bounds];
51 | if (f1.size.height*f1.size.width < f2.size.height*f2.size.width) {
52 | f1 = f2;
53 | }
54 | }
55 | self.faceView.frame = f1;
56 | }
57 | @end
58 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIPhotoSessionView.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIPhotoSessionView.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIPhotoSessionView.h"
10 |
11 | @interface IQEngUIPhotoSessionView ()
12 | @property(nonatomic, strong) AVCapturePhotoOutput *photoOutput;
13 |
14 | @end
15 |
16 | @implementation IQEngUIPhotoSessionView
17 |
18 | -(instancetype)init{
19 | if (self = [super init]) {
20 | if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return self;//判断是否支持相机
21 |
22 | if ([self.session canAddOutput:self.photoOutput]) {
23 | [self.session addOutput:self.photoOutput];
24 | }
25 | }
26 | return self;
27 | }
28 |
29 | -(void)takePhoto{
30 | AVCaptureConnection *conntion = [self.photoOutput connectionWithMediaType:AVMediaTypeVideo];
31 | if (!conntion) return;
32 | AVCapturePhotoSettings *photoSettings = [AVCapturePhotoSettings photoSettings];
33 | photoSettings.flashMode = self.flashMode;
34 | if (_photoOutput.photoSettingsForSceneMonitoring) {
35 | [self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
36 | }else{
37 | [self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
38 | }
39 | }
40 |
41 | #pragma mark - AVCapturePhotoCaptureDelegate
42 | //成功拍照回调sessionPreset
43 | -(void)captureOutput:(AVCapturePhotoOutput *)captureOutput didFinishProcessingPhotoSampleBuffer:(nullable CMSampleBufferRef)photoSampleBuffer previewPhotoSampleBuffer:(nullable CMSampleBufferRef)previewPhotoSampleBuffer resolvedSettings:(AVCaptureResolvedPhotoSettings *)resolvedSettings bracketSettings:(nullable AVCaptureBracketedStillImageSettings *)bracketSettings error:(nullable NSError *)error{
44 |
45 | NSData *data = [AVCapturePhotoOutput JPEGPhotoDataRepresentationForJPEGSampleBuffer:photoSampleBuffer previewPhotoSampleBuffer:previewPhotoSampleBuffer];
46 | UIImage *photo = [UIImage imageWithData:data];
47 | if (self.whenTakePhoto) {
48 | self.whenTakePhoto(photo);
49 | }
50 | }
51 | #pragma mark - lazy load
52 | -(AVCapturePhotoOutput *)photoOutput{
53 | if (!_photoOutput) {
54 | _photoOutput = [[AVCapturePhotoOutput alloc] init];
55 | }
56 | return _photoOutput;
57 | }
58 | -(AVCaptureOutput *)output{
59 | return self.photoOutput;
60 | }
61 | @end
62 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIQRCodeSessionView.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeSessionView.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/21.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIQRCodeSessionView.h"
10 | #import
11 |
12 | @interface IQEngUIQRCodeSessionView ()
13 | @property(nonatomic, strong) AVCaptureMetadataOutput *qrcCodeOutput;
14 |
15 | @end
16 |
17 | @implementation IQEngUIQRCodeSessionView
18 | -(instancetype)init{
19 | if (self = [super init]) {
20 | if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return self;//判断是否支持相机
21 |
22 | [self.qrcCodeOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
23 |
24 | if ([self.session canAddOutput:self.qrcCodeOutput])
25 | [self.session addOutput:self.qrcCodeOutput];
26 | self.type = IQEngMetadataObjectTypeQR;
27 | }
28 | return self;
29 | }
30 | -(void)setType:(IQEngMetadataObjectType)type{
31 |
32 | if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return;//防止在模拟器下挂掉
33 | _type = type;
34 | if (type == IQEngMetadataObjectTypeQR)
35 | {
36 | [self.qrcCodeOutput setMetadataObjectTypes:@[AVMetadataObjectTypeQRCode,
37 | AVMetadataObjectTypeEAN13Code,
38 | AVMetadataObjectTypeEAN8Code,
39 | AVMetadataObjectTypeCode128Code
40 | ]];
41 | }else{
42 | [self.qrcCodeOutput setMetadataObjectTypes:@[AVMetadataObjectTypeFace]];
43 | }
44 | }
45 | -(AVCaptureOutput *)output{
46 | return self.qrcCodeOutput;
47 | }
48 | -(AVCaptureMetadataOutput *)qrcCodeOutput{
49 | if (!_qrcCodeOutput) {
50 | _qrcCodeOutput = [[AVCaptureMetadataOutput alloc] init];
51 | }
52 | return _qrcCodeOutput;
53 | }
54 | #pragma mark - AVCaptureMetadataOutputObjectsDelegate
55 | -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection{//扫描结果回调
56 | if (self.type == IQEngMetadataObjectTypeQR) {
57 | if ([metadataObjects count] >0){
58 | //停止扫描
59 | [self stopRunning];
60 | AVMetadataObject * metadataObject = [metadataObjects objectAtIndex:0];
61 | if (self.whenFinish) self.whenFinish(metadataObject);
62 | }
63 | }else if(self.type == IQEngMetadataObjectTypeFace){
64 | if ([self.delegate respondsToSelector:@selector(captureOutput:didOutputMetadataObjects:fromConnection:)])
65 | [self.delegate captureOutput:captureOutput didOutputMetadataObjects:metadataObjects fromConnection:connection];
66 | }
67 | }
68 | @end
69 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIQRCodeView.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIQRCodeView.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIQRCodeView.h"
10 | #import "UIImage+IQEngUICamera.h"
11 |
12 | @interface IQEngUIQRCodeView ()
13 | @property(nonatomic, strong) UIView *maskView;//contentView
14 | @property(nonatomic, strong) UIImageView *scanLineView;//绿色色条
15 | @property(nonatomic, strong) UIImageView *scanBGView;
16 |
17 | @end
18 |
19 | @implementation IQEngUIQRCodeView
20 |
21 | -(void)drawRect:(CGRect)rect{
22 | [super drawRect:rect];
23 |
24 | CGRect f1 = self.maskViewFrame;
25 | UIBezierPath *aPath = [UIBezierPath bezierPathWithRect:self.bounds];
26 | [aPath appendPath:[[UIBezierPath bezierPathWithRoundedRect:f1 cornerRadius:1] bezierPathByReversingPath]];
27 |
28 | CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
29 | maskLayer.path = aPath.CGPath;
30 | self.maskView.layer.mask = maskLayer;
31 |
32 | CGRect f2 = f1;
33 | CGSize s1 = self.scanLineView.image.size;
34 | f2.size.height = s1.height/s1.width * f2.size.width;
35 | self.scanLineView.frame = f2;
36 | }
37 | -(instancetype)init{
38 | if (self = [super init]) {
39 | self.backgroundColor = [UIColor clearColor];
40 |
41 | self.maskView = [[UIView alloc] init];
42 | self.maskView.backgroundColor = [UIColor colorWithRed:10/255.0 green:10/255.0 blue:10/255.0 alpha:0.3];
43 | [self addSubview:self.maskView];
44 |
45 | self.scanLineView = [[UIImageView alloc] init];
46 | self.scanLineView.image = [UIImage imageNamed_IQEngUICamera:@"IQEngUICameraScanLine.png"];
47 | [self addSubview:self.scanLineView];
48 |
49 | self.scanBGView = [[UIImageView alloc] initWithImage:[UIImage imageNamed_IQEngUICamera:@"IQEngUICameraScanscanBg.png"]];
50 | [self addSubview:self.scanBGView];
51 |
52 | [self reloadFrame];
53 | }
54 | return self;
55 | }
56 | -(void)reloadFrame{
57 |
58 | CGRect f1 = self.maskViewFrame;
59 | f1.size.height = self.scanLineView.frame.size.height;
60 |
61 | CGRect f2 = f1;
62 | f2.origin.y = f1.origin.y + self.maskViewFrame.size.height - f1.size.height;
63 |
64 | __weak typeof(self) wself = self;
65 | [UIView animateWithDuration:4 animations:^{
66 | CGFloat orif1 = [[NSString stringWithFormat:@"%.2f",wself.scanLineView.frame.origin.y] floatValue];
67 | CGFloat orif2 = [[NSString stringWithFormat:@"%.2f",wself.maskViewFrame.origin.y] floatValue];
68 | wself.scanLineView.frame = orif1 == orif2?f2:f1;
69 | } completion:^(BOOL finished) {
70 | [wself reloadFrame];
71 | }];
72 | }
73 | -(void)layoutSubviews{
74 | [super layoutSubviews];
75 |
76 | CGRect bounds = self.bounds;
77 | self.maskView.frame = bounds;
78 | self.scanBGView.frame = self.maskViewFrame;
79 | }
80 | @end
81 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // 自定义相机
4 | //
5 | // Created by 程恒盛s on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "IQEngUIQRCodeViewController.h"
11 | #import "IQEngUIFaceViewController.h"
12 | #import "IQEngUIPhotoViewController.h"
13 | #import "IQEngUIIDCardScanViewController.h"
14 |
15 | @interface ViewController ()
16 | @property(nonatomic, strong) UITableView *tableView;
17 | @property(nonatomic, strong) NSArray *datas;
18 |
19 | @end
20 |
21 | @implementation ViewController
22 |
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | self.title = @"自定义相机";
26 | self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
27 | self.tableView.delegate = self;
28 | self.tableView.dataSource = self;
29 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"UITableViewCell"];
30 | [self.view addSubview:self.tableView];
31 |
32 | self.datas = @[@"二维码扫描",@"人脸追踪识别",@"自定义相机",@"身份证拍照"];
33 | }
34 | #pragma mark - UITableViewDelegate&UITableViewDataSource
35 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
36 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];
37 | cell.textLabel.text = [self.datas objectAtIndex:indexPath.row];
38 | return cell;
39 | }
40 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
41 | return self.datas.count;
42 | }
43 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
44 | switch (indexPath.row) {
45 | case 0:
46 | {
47 | IQEngUIQRCodeViewController *iqEngVC = [[IQEngUIQRCodeViewController alloc] init];
48 | iqEngVC.title = [self.datas objectAtIndex:indexPath.row];
49 | [self.navigationController pushViewController:iqEngVC animated:YES];
50 | iqEngVC.sessionView.type = IQEngMetadataObjectTypeQR;
51 | __weak typeof(self) wself = self;
52 | iqEngVC.sessionView.whenFinish = ^(AVMetadataObject *codeObject){
53 | AVMetadataMachineReadableCodeObject *object = (AVMetadataMachineReadableCodeObject *)codeObject;
54 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"扫描结果" message:object.stringValue preferredStyle:UIAlertControllerStyleAlert];
55 | [alert addAction:[UIAlertAction actionWithTitle:@"完成" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
56 | [wself.navigationController popViewControllerAnimated:YES];
57 | }]];
58 | [wself.navigationController presentViewController:alert animated:YES completion:nil];
59 | };
60 | }
61 | break;
62 | case 1:
63 | {
64 | IQEngUIFaceViewController *iqEngVC = [[IQEngUIFaceViewController alloc] init];
65 | iqEngVC.title = [self.datas objectAtIndex:indexPath.row];
66 | [self.navigationController pushViewController:iqEngVC animated:YES];
67 | iqEngVC.sessionView.type = IQEngMetadataObjectTypeFace;
68 | }
69 | break;
70 | case 2:
71 | {
72 | IQEngUIPhotoViewController *iqEngVC = [[IQEngUIPhotoViewController alloc] init];
73 | iqEngVC.title = [self.datas objectAtIndex:indexPath.row];
74 | iqEngVC.sessionView.whenTakePhoto = ^(UIImage *image){
75 | NSLog(@"%@",image);
76 | };
77 | [self.navigationController pushViewController:iqEngVC animated:YES];
78 | }
79 | break;
80 | case 3:
81 | {
82 | IQEngUIIDCardScanViewController *v = [[IQEngUIIDCardScanViewController alloc] init];
83 | v.shouldWriteToSavedPhotos = YES;
84 | // __weak typeof(self) wself = self;
85 | v.whenFinsh = ^(UIImage *image){
86 | // __weak typeof(self) self = wself;
87 | NSLog(@"image:%@",image);
88 | };
89 | [self presentViewController:v animated:YES completion:nil];
90 | }
91 | break;
92 | default:
93 | break;
94 | }
95 | }
96 | -(void)viewWillLayoutSubviews{
97 | [super viewWillLayoutSubviews];
98 | CGRect bounds = self.view.bounds;
99 | self.tableView.frame = bounds;
100 |
101 | }
102 | @end
103 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/xcuserdata/Herson.xcuserdatad/xcschemes/自定义相机.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
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 |
21 | ViewController *vc = [[ViewController alloc] init];
22 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
23 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:vc];
24 |
25 | [self.window makeKeyAndVisible];
26 | return YES;
27 | }
28 |
29 |
30 | - (void)applicationWillResignActive:(UIApplication *)application {
31 | // 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.
32 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
33 | }
34 |
35 |
36 | - (void)applicationDidEnterBackground:(UIApplication *)application {
37 | // 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.
38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
39 | }
40 |
41 |
42 | - (void)applicationWillEnterForeground:(UIApplication *)application {
43 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
44 | }
45 |
46 |
47 | - (void)applicationDidBecomeActive:(UIApplication *)application {
48 | // 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.
49 | }
50 |
51 |
52 | - (void)applicationWillTerminate:(UIApplication *)application {
53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
54 | // Saves changes in the application's managed object context before the application terminates.
55 | [self saveContext];
56 | }
57 |
58 |
59 | #pragma mark - Core Data stack
60 |
61 | @synthesize persistentContainer = _persistentContainer;
62 |
63 | - (NSPersistentContainer *)persistentContainer {
64 | // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.
65 | @synchronized (self) {
66 | if (_persistentContainer == nil) {
67 | _persistentContainer = [[NSPersistentContainer alloc] initWithName:@"_____"];
68 | [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
69 | if (error != nil) {
70 | // Replace this implementation with code to handle the error appropriately.
71 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
72 |
73 | /*
74 | Typical reasons for an error here include:
75 | * The parent directory does not exist, cannot be created, or disallows writing.
76 | * The persistent store is not accessible, due to permissions or data protection when the device is locked.
77 | * The device is out of space.
78 | * The store could not be migrated to the current model version.
79 | Check the error message to determine what the actual problem was.
80 | */
81 | NSLog(@"Unresolved error %@, %@", error, error.userInfo);
82 | abort();
83 | }
84 | }];
85 | }
86 | }
87 |
88 | return _persistentContainer;
89 | }
90 |
91 | #pragma mark - Core Data Saving support
92 |
93 | - (void)saveContext {
94 | NSManagedObjectContext *context = self.persistentContainer.viewContext;
95 | NSError *error = nil;
96 | if ([context hasChanges] && ![context save:&error]) {
97 | // Replace this implementation with code to handle the error appropriately.
98 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
99 | NSLog(@"Unresolved error %@, %@", error, error.userInfo);
100 | abort();
101 | }
102 | }
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/IQEngUIIDCardScanViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIIDCardScanViewController.m
3 | // 自定义相机
4 | //
5 | // Created by 力王 on 16/11/28.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import "IQEngUIIDCardScanViewController.h"
10 | #import "IQEngUIBackGroundView.h"
11 | @interface IQEngUIIDCardScanViewController ()
12 | @property(nonatomic, strong) UIButton *takePhotoButton;
13 | @property(nonatomic, strong) UIButton *backButton;
14 | @property(nonatomic, strong) UIImageView *scanBackGroundImageView;
15 | @property(nonatomic, strong) IQEngUIBackGroundView *backGroundView;
16 |
17 | @end
18 |
19 | @implementation IQEngUIIDCardScanViewController
20 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations{
21 | return UIInterfaceOrientationMaskLandscape;
22 | }
23 | - (void)viewDidLoad {
24 | [super viewDidLoad];
25 | self.view.backgroundColor = [UIColor whiteColor];
26 |
27 | self.sessionView.devicePosition = AVCaptureDevicePositionBack;
28 | [self.sessionView startRunning];
29 | [self.view addSubview:self.sessionView];
30 |
31 | self.backGroundView = [[IQEngUIBackGroundView alloc] init];
32 | [self.view addSubview:self.backGroundView];
33 |
34 | self.takePhotoButton = [[UIButton alloc] init];
35 | self.takePhotoButton.imageEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 15);
36 | self.takePhotoButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
37 | [self.takePhotoButton setBackgroundColor:[UIColor colorWithRed:252.f/255.f green:102.f/255.f blue:33.f/255.f alpha:1]];
38 | [self.takePhotoButton setImage:[UIImage imageNamed_IQEngUICamera:@"IQEngUICamera_img_camera.png"] forState:UIControlStateNormal];
39 | [self.takePhotoButton addTarget:self action:@selector(__takePhotoAction) forControlEvents:UIControlEventTouchUpInside];
40 | [self.view addSubview:self.takePhotoButton];
41 |
42 | self.backButton = [[UIButton alloc] init];
43 | self.backButton.imageEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 10);
44 | self.backButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
45 | [self.backButton setBackgroundColor:[UIColor colorWithRed:252.f/255.f green:102.f/255.f blue:33.f/255.f alpha:1]];
46 | [self.backButton setImage:[UIImage imageNamed_IQEngUICamera:@"IQEngUICamera_btn_arrows_back.png"] forState:UIControlStateNormal];
47 | [self.backButton addTarget:self action:@selector(__backButtonAction) forControlEvents:UIControlEventTouchUpInside];
48 | [self.view addSubview:self.backButton];
49 |
50 | self.scanBackGroundImageView = [[UIImageView alloc] init];
51 | [self.scanBackGroundImageView setImage:[UIImage imageNamed_IQEngUICamera:@"IQEngUICamera_imag_scan_background.png"]];
52 | [self.view addSubview:self.scanBackGroundImageView];
53 | }
54 | -(void)__backButtonAction{
55 | [self dismissViewControllerAnimated:YES completion:nil];
56 | }
57 | -(void)__takePhotoAction{
58 | //拍照
59 | [self.sessionView takePhoto];
60 | }
61 | -(void)viewWillLayoutSubviews{
62 | [super viewWillLayoutSubviews];
63 |
64 | CGRect bounds = self.view.bounds;
65 | self.sessionView.frame = bounds;
66 |
67 | CGRect f1 = bounds;
68 | f1.size = CGSizeMake(65, 65);
69 | f1.origin.y = (bounds.size.height - f1.size.height)/2;
70 | f1.origin.x = bounds.size.width - f1.size.width - 10;
71 | self.takePhotoButton.layer.cornerRadius = f1.size.width/2.f;
72 | self.takePhotoButton.frame = f1;
73 |
74 | CGRect f2 = bounds;
75 | f2.size = CGSizeMake(45, 45);
76 | f2.origin = CGPointMake(5, 5);
77 | self.backButton.layer.cornerRadius = f2.size.width/2.f;
78 | self.backButton.frame = f2;
79 |
80 | CGRect f3 = bounds;
81 | f3.size.height = bounds.size.height - 50*2;
82 | CGSize f3_size = self.scanBackGroundImageView.image.size;
83 | f3.size.width = f3.size.height/f3_size.height*f3_size.width;
84 | f3.origin.x = (bounds.size.width - f3.size.width)/2;
85 | f3.origin.y = (bounds.size.height - f3.size.height)/2;
86 | self.scanBackGroundImageView.frame= f3;
87 |
88 | [self.sessionView setTransformThatFitDeviceOrientation:UIDeviceOrientationLandscapeRight animated:YES];
89 |
90 | self.backGroundView.frame = bounds;
91 | self.backGroundView.transparentFrame = f3;
92 | }
93 | -(CGRect)effectiveRect{
94 | return self.scanBackGroundImageView.frame;
95 | }
96 |
97 | #pragma mark - lazy load
98 | -(IQEngUIPhotoSessionView *)sessionView{
99 | if (!_sessionView) {
100 | _sessionView = [[IQEngUIPhotoSessionView alloc] init];
101 | __weak typeof(self) wself = self;
102 | _sessionView.whenTakePhoto = ^(UIImage *photo){
103 | __weak typeof(self) self = wself;
104 | UIImage *image = photo;
105 | image = [UIImage image:image scaleToSize:CGSizeMake(self.view.frame.size.width, self.view.frame.size.height)];
106 | image = [UIImage imageFromImage:image inRect:self.effectiveRect];
107 | // 写入相册
108 | if (self.shouldWriteToSavedPhotos) {
109 | UIImageWriteToSavedPhotosAlbum(image, self, nil, NULL);
110 | }
111 | if (self.whenFinsh) {
112 | self.whenFinsh(image);
113 | }
114 | [self dismissViewControllerAnimated:YES completion:nil];
115 | };
116 | }
117 | return _sessionView;
118 | }
119 | @end
120 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIAVCaptureSessionView_base.m:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIAVCaptureSessionView_base.m
3 | // 自定义相机
4 | //
5 |
6 | // Created by 力王 on 16/11/17.
7 | // Copyright © 2016年 Herson. All rights reserved.
8 | //
9 | /*AVCaptureSessionPresetLow,AVCaptureSessionPresetHigh,AVCaptureSessionPresetPhoto,AVCaptureSessionPresetMedium,AVCaptureSessionPreset352x288,AVCaptureSessionPreset640x480,AVCaptureSessionPreset1280x720,AVCaptureSessionPreset1920x1080,AVCaptureSessionPreset3840x2160,AVCaptureSessionPresetiFrame960x540,AVCaptureSessionPresetInputPriority,AVCaptureSessionPresetiFrame1280x720*/
10 |
11 |
12 | #import "IQEngUIAVCaptureSessionView_base.h"
13 |
14 | DEF_EnumTypeCategories(IQEngAVCaptureSessionPreset, (
15 | @{
16 | @(IQEngAVCaptureSessionPresetLow):AVCaptureSessionPresetLow,
17 | @(IQEngAVCaptureSessionPresetHigh):AVCaptureSessionPresetHigh,
18 | @(IQEngAVCaptureSessionPresetPhoto):AVCaptureSessionPresetPhoto,
19 | @(IQEngAVCaptureSessionPresetMedium):AVCaptureSessionPresetMedium,
20 | @(IQEngAVCaptureSessionPreset352x288):AVCaptureSessionPreset352x288,
21 | @(IQEngAVCaptureSessionPreset640x480):AVCaptureSessionPreset640x480,
22 | @(IQEngAVCaptureSessionPreset1280x720):AVCaptureSessionPreset1280x720,
23 | @(IQEngAVCaptureSessionPreset1920x1080):AVCaptureSessionPreset1920x1080,
24 | @(IQEngAVCaptureSessionPreset3840x2160):AVCaptureSessionPreset3840x2160,
25 | @(IQEngAVCaptureSessionPresetiFrame960x540):AVCaptureSessionPresetiFrame960x540,
26 | @(IQEngAVCaptureSessionPresetInputPriority):AVCaptureSessionPresetInputPriority,
27 | @(IQEngAVCaptureSessionPresetiFrame1280x720):AVCaptureSessionPresetiFrame1280x720})
28 | )
29 |
30 | @interface IQEngUIAVCaptureSessionView_base ()
31 | @property (nonatomic, strong) AVCaptureSession *session;
32 | @property(nonatomic, strong) UITapGestureRecognizer *tapGestureRecognizer;
33 | @property(nonatomic, strong) UIView *focusView;
34 | @property (nonatomic ,strong) AVCaptureVideoPreviewLayer *previewLayer;
35 | @end
36 |
37 | @implementation IQEngUIAVCaptureSessionView_base
38 |
39 | -(instancetype)init{
40 | if (self = [super init]) {
41 |
42 | if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return self;//判断是否支持相机
43 |
44 | _showFocusView = YES;
45 | _devicePosition = AVCaptureDevicePositionBack;
46 | _sessionPreset = IQEngAVCaptureSessionPresetPhoto;
47 |
48 | self.device = [self cameraWithPosition:self.devicePosition];
49 | //初始化输入设备
50 | self.input = [[AVCaptureDeviceInput alloc] initWithDevice:self.device error:nil];
51 | // self.photoOutput = [[AVCapturePhotoOutput alloc] init];
52 | self.session = [[AVCaptureSession alloc] init];
53 |
54 | self.session.sessionPreset = [NSString stringWithIQEngAVCaptureSessionPreset:self.sessionPreset];
55 | //输入输出设备结合
56 | if ([self.session canAddInput:self.input]) {
57 | [self.session addInput:self.input];
58 | }
59 | // if ([self.session canAddOutput:self.photoOutput]) {
60 | // [self.session addOutput:self.photoOutput];
61 | // }
62 | //预览层的生成
63 | self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
64 | self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
65 | [self.layer addSublayer:self.previewLayer];
66 |
67 | //设置闪关灯初始状态
68 | _flashMode = AVCaptureFlashModeAuto;
69 | //添加手势
70 | self.tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(whenTapGesture:)];
71 | [self addGestureRecognizer:self.tapGestureRecognizer];
72 |
73 | self.focusView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
74 | self.focusView.layer.borderWidth = 1;
75 | self.focusView.layer.borderColor = [UIColor redColor].CGColor;
76 | [self addSubview:self.focusView];
77 | self.focusView.hidden = YES;
78 | }
79 | return self;
80 | }
81 |
82 | -(void)whenTapGesture:(UITapGestureRecognizer *)tap{
83 | [self focusAtPoint:[tap locationInView:tap.view]];
84 | }
85 | - (AVCaptureDevice *)cameraWithPosition:(AVCaptureDevicePosition)position{
86 | #pragma clang diagnostic push
87 | #pragma clang diagnostic ignored "-Wdeprecated-declarations"
88 | //此方法iOS 10 之后已经弃用 "Use AVCaptureDeviceDiscoverySession instead."
89 | NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
90 | #pragma clang diagnostic pop
91 | for ( AVCaptureDevice *device in devices )
92 | if ( device.position == position ){
93 | return device;
94 | }
95 | return nil;
96 | }
97 | - (void)focusAtPoint:(CGPoint)point{
98 | if (!self.showFocusView) return;
99 | [IQEngUIAVCaptureSessionView_base cancelPreviousPerformRequestsWithTarget:self];//取消延迟加载
100 |
101 | CGSize size = self.bounds.size;
102 | CGPoint focusPoint = CGPointMake( point.y /size.height ,1-point.x/size.width );
103 | NSError *error;
104 | if ([self.device lockForConfiguration:&error]) {
105 | //对焦模式和对焦点
106 | if ([self.device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
107 | [self.device setFocusPointOfInterest:focusPoint];
108 | [self.device setFocusMode:AVCaptureFocusModeAutoFocus];
109 | }
110 | //曝光模式和曝光点
111 | if ([self.device isExposureModeSupported:AVCaptureExposureModeAutoExpose ]) {
112 | [self.device setExposurePointOfInterest:focusPoint];
113 | [self.device setExposureMode:AVCaptureExposureModeAutoExpose];
114 | }
115 |
116 | [self.device unlockForConfiguration];
117 | //设置对焦动画
118 | _focusView.center = point;
119 | _focusView.hidden = NO;
120 | [UIView animateWithDuration:0.3 animations:^{
121 | _focusView.transform = CGAffineTransformMakeScale(1.25, 1.25);
122 | }completion:^(BOOL finished) {
123 | [UIView animateWithDuration:0.3 animations:^{
124 | _focusView.transform = CGAffineTransformIdentity;
125 | } completion:^(BOOL finished) {
126 | [self performSelector:@selector(__hiddenFocusView) withObject:nil afterDelay:1];
127 | }];
128 | }];
129 | }
130 | }
131 | -(void)__hiddenFocusView{
132 | _focusView.hidden = YES;
133 | }
134 | //设置前后摄像头
135 | -(void)setDevicePosition:(AVCaptureDevicePosition)devicePosition{
136 | _devicePosition = devicePosition;
137 |
138 | AVCaptureDevice *newCamera = nil;
139 | AVCaptureDeviceInput *newInput = nil;
140 |
141 | newCamera = [self cameraWithPosition:devicePosition];
142 | //拿到另外一个摄像头位置
143 | // AVCaptureDevicePosition position = [[_input device] position];
144 | // if (position == AVCaptureDevicePositionFront){
145 | // newCamera = [self cameraWithPosition:AVCaptureDevicePositionBack];
146 | // }else {
147 | // newCamera = [self cameraWithPosition:AVCaptureDevicePositionFront];
148 | // }
149 | //生成新的输入
150 | newInput = [AVCaptureDeviceInput deviceInputWithDevice:newCamera error:nil];
151 | if (newInput != nil) {
152 | [self.session beginConfiguration];
153 | [self.session removeInput:self.input];
154 | if ([self.session canAddInput:newInput]) {
155 | [self.session addInput:newInput];
156 | self.input = newInput;
157 | } else {
158 | [self.session addInput:self.input];
159 | }
160 | [self.session commitConfiguration];
161 | }
162 | }
163 | //设置闪光灯
164 | -(void)setFlashMode:(AVCaptureFlashMode)flashMode{
165 | _flashMode = flashMode;
166 |
167 | if ([_device lockForConfiguration:nil]) {
168 | //自动白平衡
169 | if ([_device isWhiteBalanceModeSupported:AVCaptureWhiteBalanceModeAutoWhiteBalance]) {
170 | [_device setWhiteBalanceMode:AVCaptureWhiteBalanceModeAutoWhiteBalance];
171 | }
172 | [_device unlockForConfiguration];
173 | }
174 | }
175 | -(void)setSessionPreset:(IQEngAVCaptureSessionPreset)sessionPreset{
176 | _sessionPreset = sessionPreset;
177 |
178 | if ([_device lockForConfiguration:nil]) {
179 | //设置图片品质
180 | self.session.sessionPreset = [NSString stringWithIQEngAVCaptureSessionPreset:sessionPreset];
181 | [_device unlockForConfiguration];
182 | }
183 | }
184 | //-(void)takePhoto{
185 | // AVCaptureConnection *conntion = [self.photoOutput connectionWithMediaType:AVMediaTypeVideo];
186 | // if (!conntion) return;
187 | // AVCapturePhotoSettings *photoSettings = [AVCapturePhotoSettings photoSettings];
188 | // photoSettings.flashMode = self.flashMode;
189 | // if (_photoOutput.photoSettingsForSceneMonitoring) {
190 | // [self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
191 | // }else{
192 | // [self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
193 | // }
194 | //
195 | //}
196 | -(void)startRunning{
197 | //设备取景开始
198 | [self.session startRunning];
199 | }
200 | - (void)stopRunning{
201 | [self.session stopRunning];
202 | }
203 | -(void)layoutSubviews{
204 | [super layoutSubviews];
205 | CGRect bounds = self.bounds;
206 | self.previewLayer.frame = bounds;
207 | }
208 | @end
209 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机/libs/IQEngUIAVCaptureSessionView_base.h:
--------------------------------------------------------------------------------
1 | //
2 | // IQEngUIAVCaptureSessionView_base.h
3 | // 自定义相机成像基类
4 | //
5 | // Created by 力王 on 16/11/17.
6 | // Copyright © 2016年 Herson. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "UIImage+IQEngUICamera.h"
12 | #import "UIView+IQEngUICamera.h"
13 |
14 |
15 | //添加enum类型与NSString转换的便捷宏###########################{
16 | //enum=>NSString
17 | #define AS_EnumValueToNSString(EnumType)\
18 | + (NSString *)stringWith##EnumType:(EnumType)value;
19 | #define DEF_EnumValueToNSString(EnumType,__staticMapDictionary)\
20 | + (NSString *)stringWith##EnumType:(EnumType)enumValue{\
21 | static NSDictionary *staticMap;\
22 | if(!staticMap){\
23 | NSDictionary *mapDictionary = (__staticMapDictionary);\
24 | NSMutableDictionary *map = [[NSMutableDictionary alloc] initWithCapacity:mapDictionary.count];\
25 | for(id key in mapDictionary){\
26 | id value = [mapDictionary objectForKey:key];\
27 | if([key isKindOfClass:[NSNumber class]]){\
28 | [map setObject:value forKey:key];\
29 | }else{\
30 | [map setObject:key forKey:value];\
31 | }\
32 | }\
33 | staticMap = (map);\
34 | }\
35 | NSString *str = staticMap[@(enumValue)];\
36 | if(!str){\
37 | str = [@(enumValue) stringValue];\
38 | }\
39 | return str;\
40 | }
41 | //NSString=>enum
42 | #define AS_EnumValueFromNSString(EnumType)\
43 | - (EnumType)EnumType;
44 | #define DEF_EnumValueFromNSString(EnumType,__staticMapDictionary)\
45 | - (EnumType)EnumType{\
46 | static NSDictionary *staticMap;\
47 | if(!staticMap){\
48 | NSDictionary *mapDictionary = (__staticMapDictionary);\
49 | NSMutableDictionary *map = [[NSMutableDictionary alloc] initWithCapacity:mapDictionary.count];\
50 | for (id key in mapDictionary) {\
51 | id value = [mapDictionary objectForKey:key];\
52 | if([key isKindOfClass:[NSNumber class]]){\
53 | [map setObject:key forKey:value];\
54 | }else{\
55 | [map setObject:value forKey:key];\
56 | }\
57 | }\
58 | staticMap = map;\
59 | }\
60 | EnumType enumValue = (EnumType)[staticMap[self] integerValue];\
61 | return enumValue;\
62 | }
63 |
64 | //enum<=>NSString
65 | #define AS_EnumValue_NSString(EnumType)\
66 | AS_EnumValueToNSString(EnumType)\
67 | AS_EnumValueFromNSString(EnumType)
68 | #define DEF_EnumValue_NSString(EnumType,__staticMapDictionary)\
69 | DEF_EnumValueToNSString(EnumType,__staticMapDictionary)\
70 | DEF_EnumValueFromNSString(EnumType,__staticMapDictionary)
71 |
72 | //定义NSString(enum)的类别
73 | #define AS_EnumTypeCategoryToNSString(EnumType)\
74 | @interface NSString(EnumType)\
75 | AS_EnumValue_NSString(EnumType)\
76 | @end
77 | #define DEF_EnumTypeCategoryToNSString(EnumType,__staticMapDictionary)\
78 | @implementation NSString(EnumType)\
79 | DEF_EnumValue_NSString(EnumType,(__staticMapDictionary))\
80 | @end
81 |
82 | //添加enum类型数据从NSDictionary中获取的便捷宏
83 | //NSDictionary[path]|otherwise=>enum
84 | #define AS_EnumValueFromNSDictionaryAtPathAndOtherwise(EnumType)\
85 | - (EnumType)EnumType##AtPath:(NSString *)path otherwise:(EnumType)otherwise;
86 | #define DEF_EnumValueFromNSDictionaryAtPathAndOtherwise(EnumType)\
87 | - (EnumType)EnumType##AtPath:(NSString *)path otherwise:(EnumType)otherwise{\
88 | EnumType enumValue = otherwise;\
89 | id obj = [self valueForKeyPath:path];\
90 | if(obj==[NSNull null]){\
91 | obj = nil;\
92 | }\
93 | if(obj){\
94 | if([obj isKindOfClass:[NSNumber class]]){\
95 | enumValue = (EnumType)[(NSNumber *)obj integerValue];\
96 | }else if([obj isKindOfClass:[NSString class]]){\
97 | NSString *str = (NSString *)obj;\
98 | NSScanner *scanner = [[NSScanner alloc] initWithString:str];\
99 | NSInteger value = 0;\
100 | if([scanner scanInteger:&value]&&scanner.isAtEnd){\
101 | enumValue = (EnumType)value;\
102 | }else{\
103 | enumValue = [str EnumType];\
104 | }\
105 | }else{\
106 | enumValue = [[obj description] EnumType];\
107 | }\
108 | }\
109 | return enumValue;\
110 | }
111 |
112 | //NSDictionary[path]=>enum
113 | #define AS_EnumValueFromNSDictionaryAtPath(EnumType)\
114 | - (EnumType)EnumType##AtPath:(NSString *)path;
115 | #define DEF_EnumValueFromNSDictionaryAtPath(EnumType)\
116 | - (EnumType)EnumType##AtPath:(NSString *)path{\
117 | EnumType enumValue = (EnumType)0;\
118 | id obj = [self valueForKeyPath:path];\
119 | if(obj==[NSNull null]){\
120 | obj = nil;\
121 | }\
122 | if(obj){\
123 | if([obj isKindOfClass:[NSNumber class]]){\
124 | enumValue = (EnumType)[(NSNumber *)obj integerValue];\
125 | }else if([obj isKindOfClass:[NSString class]]){\
126 | NSString *str = (NSString *)obj;\
127 | NSScanner *scanner = [[NSScanner alloc] initWithString:str];\
128 | NSInteger value = 0;\
129 | if([scanner scanInteger:&value]&&scanner.isAtEnd){\
130 | enumValue = (EnumType)value;\
131 | }else{\
132 | enumValue = [str EnumType];\
133 | }\
134 | }else{\
135 | enumValue = [[obj description] EnumType];\
136 | }\
137 | }\
138 | return enumValue;\
139 | }
140 |
141 | //NSDictionary[path]|otherwise=>enum,NSDictionary[path]=>enum
142 | #define AS_EnumValueFromNSDictionary(EnumType)\
143 | AS_EnumValueFromNSDictionaryAtPathAndOtherwise(EnumType)\
144 | AS_EnumValueFromNSDictionaryAtPath(EnumType)
145 | #define DEF_EnumValueFromNSDictionary(EnumType)\
146 | DEF_EnumValueFromNSDictionaryAtPathAndOtherwise(EnumType)\
147 | DEF_EnumValueFromNSDictionaryAtPath(EnumType)
148 |
149 | //定义NSDictionary(enum)的类别
150 | #define AS_EnumTypeCategoryToNSDictionary(EnumType)\
151 | @interface NSDictionary(EnumType)\
152 | AS_EnumValueFromNSDictionary(EnumType)\
153 | @end
154 | #define DEF_EnumTypeCategoryToNSDictionary(EnumType)\
155 | @implementation NSDictionary(EnumType)\
156 | DEF_EnumValueFromNSDictionary(EnumType)\
157 | @end
158 |
159 | //给Enum添加NSString与NSDictionry的category
160 | //__staticMapDictionary为NSDicionary,key为enum取值的NSNumber,value为enum值对应的NSString,例如:DEF_EnumTypeCategories(UIViewAnimationCurve,(@{@(UIViewAnimationCurveEaseInOut):@"EaseInOut",@(UIViewAnimationCurveEaseIn):@"EaseIn",@(UIViewAnimationCurveEaseOut):@"EaseOut",@(UIViewAnimationCurveLinear):@"Linear"}))
161 | #define AS_EnumTypeCategories(EnumType)\
162 | AS_EnumTypeCategoryToNSString(EnumType)\
163 | AS_EnumTypeCategoryToNSDictionary(EnumType)
164 | #define DEF_EnumTypeCategories(EnumType,__staticMapDictionary)\
165 | DEF_EnumTypeCategoryToNSString(EnumType,__staticMapDictionary)\
166 | DEF_EnumTypeCategoryToNSDictionary(EnumType)
167 |
168 | //添加enum类型与NSString转换的便捷宏###########################}
169 |
170 |
171 |
172 | //添加Mask类型与NSString转换的便捷宏###########################{
173 | //OptionMask掩码值=>NSString
174 | #define AS_OptionValue_NSString(OptionType)\
175 | + (NSString *)stringWithOPTIONS##OptionType:(OptionType)optionValue;
176 |
177 | #define DEF_OptionValue_NSString(OptionType,__staticMapDictionary)\
178 | + (NSString *)stringWithOPTIONS##OptionType:(OptionType)optionValue{\
179 | NSMutableArray *masks = [[NSMutableArray alloc] init];\
180 | static NSDictionary *staticMap;\
181 | if(!staticMap){\
182 | NSDictionary *mapDictionary = (__staticMapDictionary);\
183 | NSMutableDictionary *map = [[NSMutableDictionary alloc] initWithCapacity:mapDictionary.count];\
184 | for (id key in mapDictionary) {\
185 | id value = [mapDictionary objectForKey:key];\
186 | if([key isKindOfClass:[NSNumber class]]){\
187 | [map setObject:value forKey:key];\
188 | }else{\
189 | [map setObject:key forKey:value];\
190 | }\
191 | }\
192 | staticMap = map;\
193 | }\
194 | for (NSNumber *num in staticMap) {\
195 | OptionType v = (OptionType)[num integerValue];\
196 | if((optionValue&v)==v){\
197 | NSString *s = staticMap[num];\
198 | [masks addObject:s];\
199 | }\
200 | }\
201 | NSString *str = [masks componentsJoinedByString:@"|"];\
202 | return str;\
203 | }
204 | //添加Mask类型与NSString转换的便捷宏###########################}
205 |
206 |
207 | typedef NS_ENUM(NSInteger, IQEngAVCaptureSessionPreset) {
208 | IQEngAVCaptureSessionPresetLow = 0,
209 | IQEngAVCaptureSessionPresetHigh,
210 | IQEngAVCaptureSessionPresetPhoto,
211 | IQEngAVCaptureSessionPresetMedium,
212 | IQEngAVCaptureSessionPreset352x288,
213 | IQEngAVCaptureSessionPreset640x480,
214 | IQEngAVCaptureSessionPreset1280x720,
215 | IQEngAVCaptureSessionPreset1920x1080,
216 | IQEngAVCaptureSessionPreset3840x2160,
217 | IQEngAVCaptureSessionPresetiFrame960x540,
218 | IQEngAVCaptureSessionPresetInputPriority,
219 | IQEngAVCaptureSessionPresetiFrame1280x720
220 | };
221 | AS_EnumTypeCategories(IQEngAVCaptureSessionPreset);
222 |
223 | @interface IQEngUIAVCaptureSessionView_base : UIView
224 |
225 | //session:输入输出结合在一起,并开始启动捕获设备(摄像头)
226 | @property (nonatomic, readonly) AVCaptureSession *session;
227 | //捕获设备,通常是前置摄像头,后置摄像头,麦克风(音频输入)
228 | @property(nonatomic, strong) AVCaptureDevice *device;
229 | //AVCaptureDeviceInput 代表输入设备,他使用AVCaptureDevice 来初始化
230 | @property (nonatomic, strong) AVCaptureDeviceInput *input;
231 | //输出图片
232 | @property (nonatomic ,strong) AVCaptureOutput *output;
233 | //图像预览层,实时显示捕获的图像
234 | @property (nonatomic ,readonly) AVCaptureVideoPreviewLayer *previewLayer;
235 |
236 |
237 | //选择前后摄像头(默认为后摄像头)
238 | @property(nonatomic, assign) AVCaptureDevicePosition devicePosition;
239 | //设置图片品质(默认IQEngAVCaptureSessionPresetPhoto)
240 | @property(nonatomic, assign) IQEngAVCaptureSessionPreset sessionPreset;
241 | //闪光模式
242 | @property(nonatomic, assign) AVCaptureFlashMode flashMode;
243 | //是否显示关闭对焦功能 (默认为YES)
244 | @property(nonatomic, assign) BOOL showFocusView;
245 | /**
246 | 根据前后置位置拿到相应的摄像头:
247 |
248 | @param position 前后摄像头枚举
249 |
250 | @return AVCaptureDevice 设备
251 | */
252 | - (AVCaptureDevice *)cameraWithPosition:(AVCaptureDevicePosition)position;
253 | ///**
254 | // 拍照
255 | // */
256 | //-(void)takePhoto;
257 |
258 | -(void)startRunning;//开始取景
259 | - (void)stopRunning;//结束取景
260 | @end
261 |
--------------------------------------------------------------------------------
/自定义相机/自定义相机.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 306260951DEBD07D00E35102 /* IQEngUIPhotoSessionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 306260941DEBD07D00E35102 /* IQEngUIPhotoSessionView.m */; };
11 | 306260981DEBE6A900E35102 /* IQEngUIFaceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 306260971DEBE6A900E35102 /* IQEngUIFaceViewController.m */; };
12 | 3062609B1DEBE87100E35102 /* IQEngUIPhotoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3062609A1DEBE87100E35102 /* IQEngUIPhotoViewController.m */; };
13 | 3062609E1DEC3A7500E35102 /* IQEngUIQRCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3062609D1DEC3A7500E35102 /* IQEngUIQRCodeView.m */; };
14 | 306260A61DEE7C4300E35102 /* IQEngUICamera.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 306260A51DEE7C4300E35102 /* IQEngUICamera.bundle */; };
15 | 306260A91DEE7C9A00E35102 /* NSBundle+IQEngUICamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 306260A81DEE7C9A00E35102 /* NSBundle+IQEngUICamera.m */; };
16 | 306260AC1DEE7EE600E35102 /* UIImage+IQEngUICamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 306260AB1DEE7EE600E35102 /* UIImage+IQEngUICamera.m */; };
17 | 30760F711E7790B600BA06B9 /* IQEngUIBackGroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30760F6E1E7790B600BA06B9 /* IQEngUIBackGroundView.m */; };
18 | 30760F721E7790B600BA06B9 /* IQEngUIIDCardScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30760F701E7790B600BA06B9 /* IQEngUIIDCardScanViewController.m */; };
19 | 30760F751E77915800BA06B9 /* UIView+IQEngUICamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 30760F741E77915800BA06B9 /* UIView+IQEngUICamera.m */; };
20 | 3080633C1DDD59C500D8C2F4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3080633B1DDD59C500D8C2F4 /* main.m */; };
21 | 3080633F1DDD59C500D8C2F4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3080633E1DDD59C500D8C2F4 /* AppDelegate.m */; };
22 | 308063421DDD59C500D8C2F4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 308063411DDD59C500D8C2F4 /* ViewController.m */; };
23 | 308063451DDD59C500D8C2F4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 308063431DDD59C500D8C2F4 /* Main.storyboard */; };
24 | 308063481DDD59C500D8C2F4 /* _____.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 308063461DDD59C500D8C2F4 /* _____.xcdatamodeld */; };
25 | 3080634A1DDD59C500D8C2F4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 308063491DDD59C500D8C2F4 /* Assets.xcassets */; };
26 | 3080634D1DDD59C500D8C2F4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3080634B1DDD59C500D8C2F4 /* LaunchScreen.storyboard */; };
27 | 308063581DDD59C500D8C2F4 /* _____UITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 308063571DDD59C500D8C2F4 /* _____UITests.m */; };
28 | 308063651DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.m in Sources */ = {isa = PBXBuildFile; fileRef = 308063641DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.m */; };
29 | 308063CC1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 308063CB1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.m */; };
30 | 308067C51DE4157200D8C2F4 /* IQEngUIQRCodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 308067C41DE4157200D8C2F4 /* IQEngUIQRCodeViewController.m */; };
31 | /* End PBXBuildFile section */
32 |
33 | /* Begin PBXContainerItemProxy section */
34 | 308063541DDD59C500D8C2F4 /* PBXContainerItemProxy */ = {
35 | isa = PBXContainerItemProxy;
36 | containerPortal = 3080632F1DDD59C500D8C2F4 /* Project object */;
37 | proxyType = 1;
38 | remoteGlobalIDString = 308063361DDD59C500D8C2F4;
39 | remoteInfo = "自定义相机";
40 | };
41 | /* End PBXContainerItemProxy section */
42 |
43 | /* Begin PBXFileReference section */
44 | 306260931DEBD07D00E35102 /* IQEngUIPhotoSessionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IQEngUIPhotoSessionView.h; path = libs/IQEngUIPhotoSessionView.h; sourceTree = ""; };
45 | 306260941DEBD07D00E35102 /* IQEngUIPhotoSessionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IQEngUIPhotoSessionView.m; path = libs/IQEngUIPhotoSessionView.m; sourceTree = ""; };
46 | 306260961DEBE6A900E35102 /* IQEngUIFaceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQEngUIFaceViewController.h; sourceTree = ""; };
47 | 306260971DEBE6A900E35102 /* IQEngUIFaceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQEngUIFaceViewController.m; sourceTree = ""; };
48 | 306260991DEBE87100E35102 /* IQEngUIPhotoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQEngUIPhotoViewController.h; sourceTree = ""; };
49 | 3062609A1DEBE87100E35102 /* IQEngUIPhotoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQEngUIPhotoViewController.m; sourceTree = ""; };
50 | 3062609C1DEC3A7500E35102 /* IQEngUIQRCodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IQEngUIQRCodeView.h; path = libs/IQEngUIQRCodeView.h; sourceTree = ""; };
51 | 3062609D1DEC3A7500E35102 /* IQEngUIQRCodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IQEngUIQRCodeView.m; path = libs/IQEngUIQRCodeView.m; sourceTree = ""; };
52 | 306260A51DEE7C4300E35102 /* IQEngUICamera.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = IQEngUICamera.bundle; path = libs/IQEngUICamera.bundle; sourceTree = ""; };
53 | 306260A71DEE7C9A00E35102 /* NSBundle+IQEngUICamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSBundle+IQEngUICamera.h"; path = "libs/NSBundle+IQEngUICamera.h"; sourceTree = ""; };
54 | 306260A81DEE7C9A00E35102 /* NSBundle+IQEngUICamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSBundle+IQEngUICamera.m"; path = "libs/NSBundle+IQEngUICamera.m"; sourceTree = ""; };
55 | 306260AA1DEE7EE600E35102 /* UIImage+IQEngUICamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+IQEngUICamera.h"; path = "libs/UIImage+IQEngUICamera.h"; sourceTree = ""; };
56 | 306260AB1DEE7EE600E35102 /* UIImage+IQEngUICamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+IQEngUICamera.m"; path = "libs/UIImage+IQEngUICamera.m"; sourceTree = ""; };
57 | 30760F6D1E7790B600BA06B9 /* IQEngUIBackGroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQEngUIBackGroundView.h; sourceTree = ""; };
58 | 30760F6E1E7790B600BA06B9 /* IQEngUIBackGroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQEngUIBackGroundView.m; sourceTree = ""; };
59 | 30760F6F1E7790B600BA06B9 /* IQEngUIIDCardScanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQEngUIIDCardScanViewController.h; sourceTree = ""; };
60 | 30760F701E7790B600BA06B9 /* IQEngUIIDCardScanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQEngUIIDCardScanViewController.m; sourceTree = ""; };
61 | 30760F731E77915800BA06B9 /* UIView+IQEngUICamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+IQEngUICamera.h"; sourceTree = ""; };
62 | 30760F741E77915800BA06B9 /* UIView+IQEngUICamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+IQEngUICamera.m"; sourceTree = ""; };
63 | 308063371DDD59C500D8C2F4 /* 自定义相机.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "自定义相机.app"; sourceTree = BUILT_PRODUCTS_DIR; };
64 | 3080633B1DDD59C500D8C2F4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
65 | 3080633D1DDD59C500D8C2F4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
66 | 3080633E1DDD59C500D8C2F4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
67 | 308063401DDD59C500D8C2F4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
68 | 308063411DDD59C500D8C2F4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
69 | 308063441DDD59C500D8C2F4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
70 | 308063471DDD59C500D8C2F4 /* _____.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "_____.xcdatamodel"; sourceTree = ""; };
71 | 308063491DDD59C500D8C2F4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
72 | 3080634C1DDD59C500D8C2F4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
73 | 3080634E1DDD59C500D8C2F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
74 | 308063531DDD59C500D8C2F4 /* 自定义相机UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "自定义相机UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
75 | 308063571DDD59C500D8C2F4 /* _____UITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "_____UITests.m"; sourceTree = ""; };
76 | 308063591DDD59C500D8C2F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
77 | 308063631DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IQEngUIAVCaptureSessionView_base.h; path = libs/IQEngUIAVCaptureSessionView_base.h; sourceTree = ""; };
78 | 308063641DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IQEngUIAVCaptureSessionView_base.m; path = libs/IQEngUIAVCaptureSessionView_base.m; sourceTree = ""; };
79 | 308063CA1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IQEngUIQRCodeSessionView.h; path = libs/IQEngUIQRCodeSessionView.h; sourceTree = ""; };
80 | 308063CB1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IQEngUIQRCodeSessionView.m; path = libs/IQEngUIQRCodeSessionView.m; sourceTree = ""; };
81 | 308067C31DE4157200D8C2F4 /* IQEngUIQRCodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQEngUIQRCodeViewController.h; sourceTree = ""; };
82 | 308067C41DE4157200D8C2F4 /* IQEngUIQRCodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQEngUIQRCodeViewController.m; sourceTree = ""; };
83 | /* End PBXFileReference section */
84 |
85 | /* Begin PBXFrameworksBuildPhase section */
86 | 308063341DDD59C500D8C2F4 /* Frameworks */ = {
87 | isa = PBXFrameworksBuildPhase;
88 | buildActionMask = 2147483647;
89 | files = (
90 | );
91 | runOnlyForDeploymentPostprocessing = 0;
92 | };
93 | 308063501DDD59C500D8C2F4 /* Frameworks */ = {
94 | isa = PBXFrameworksBuildPhase;
95 | buildActionMask = 2147483647;
96 | files = (
97 | );
98 | runOnlyForDeploymentPostprocessing = 0;
99 | };
100 | /* End PBXFrameworksBuildPhase section */
101 |
102 | /* Begin PBXGroup section */
103 | 306260AD1DEE7EEA00E35102 /* base */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 30760F731E77915800BA06B9 /* UIView+IQEngUICamera.h */,
107 | 30760F741E77915800BA06B9 /* UIView+IQEngUICamera.m */,
108 | 306260A71DEE7C9A00E35102 /* NSBundle+IQEngUICamera.h */,
109 | 306260A81DEE7C9A00E35102 /* NSBundle+IQEngUICamera.m */,
110 | 306260AA1DEE7EE600E35102 /* UIImage+IQEngUICamera.h */,
111 | 306260AB1DEE7EE600E35102 /* UIImage+IQEngUICamera.m */,
112 | );
113 | name = base;
114 | sourceTree = "";
115 | };
116 | 30760F761E7791DE00BA06B9 /* dome1 */ = {
117 | isa = PBXGroup;
118 | children = (
119 | 308067C31DE4157200D8C2F4 /* IQEngUIQRCodeViewController.h */,
120 | 308067C41DE4157200D8C2F4 /* IQEngUIQRCodeViewController.m */,
121 | );
122 | name = dome1;
123 | sourceTree = "";
124 | };
125 | 30760F771E7791E900BA06B9 /* dome2 */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 306260961DEBE6A900E35102 /* IQEngUIFaceViewController.h */,
129 | 306260971DEBE6A900E35102 /* IQEngUIFaceViewController.m */,
130 | );
131 | name = dome2;
132 | sourceTree = "";
133 | };
134 | 30760F781E77921000BA06B9 /* dome3 */ = {
135 | isa = PBXGroup;
136 | children = (
137 | 306260991DEBE87100E35102 /* IQEngUIPhotoViewController.h */,
138 | 3062609A1DEBE87100E35102 /* IQEngUIPhotoViewController.m */,
139 | );
140 | name = dome3;
141 | sourceTree = "";
142 | };
143 | 30760F791E77922000BA06B9 /* dome4 */ = {
144 | isa = PBXGroup;
145 | children = (
146 | 30760F6D1E7790B600BA06B9 /* IQEngUIBackGroundView.h */,
147 | 30760F6E1E7790B600BA06B9 /* IQEngUIBackGroundView.m */,
148 | 30760F6F1E7790B600BA06B9 /* IQEngUIIDCardScanViewController.h */,
149 | 30760F701E7790B600BA06B9 /* IQEngUIIDCardScanViewController.m */,
150 | );
151 | name = dome4;
152 | sourceTree = "";
153 | };
154 | 3080632E1DDD59C500D8C2F4 = {
155 | isa = PBXGroup;
156 | children = (
157 | 308063391DDD59C500D8C2F4 /* 自定义相机 */,
158 | 308063561DDD59C500D8C2F4 /* 自定义相机UITests */,
159 | 308063381DDD59C500D8C2F4 /* Products */,
160 | );
161 | sourceTree = "";
162 | };
163 | 308063381DDD59C500D8C2F4 /* Products */ = {
164 | isa = PBXGroup;
165 | children = (
166 | 308063371DDD59C500D8C2F4 /* 自定义相机.app */,
167 | 308063531DDD59C500D8C2F4 /* 自定义相机UITests.xctest */,
168 | );
169 | name = Products;
170 | sourceTree = "";
171 | };
172 | 308063391DDD59C500D8C2F4 /* 自定义相机 */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 308063621DDD59FC00D8C2F4 /* libs */,
176 | 308063401DDD59C500D8C2F4 /* ViewController.h */,
177 | 308063411DDD59C500D8C2F4 /* ViewController.m */,
178 | 30760F761E7791DE00BA06B9 /* dome1 */,
179 | 30760F771E7791E900BA06B9 /* dome2 */,
180 | 30760F781E77921000BA06B9 /* dome3 */,
181 | 30760F791E77922000BA06B9 /* dome4 */,
182 | 3080633A1DDD59C500D8C2F4 /* Supporting Files */,
183 | );
184 | path = "自定义相机";
185 | sourceTree = "";
186 | };
187 | 3080633A1DDD59C500D8C2F4 /* Supporting Files */ = {
188 | isa = PBXGroup;
189 | children = (
190 | 308063431DDD59C500D8C2F4 /* Main.storyboard */,
191 | 308063491DDD59C500D8C2F4 /* Assets.xcassets */,
192 | 3080634B1DDD59C500D8C2F4 /* LaunchScreen.storyboard */,
193 | 3080634E1DDD59C500D8C2F4 /* Info.plist */,
194 | 308063461DDD59C500D8C2F4 /* _____.xcdatamodeld */,
195 | 3080633D1DDD59C500D8C2F4 /* AppDelegate.h */,
196 | 3080633E1DDD59C500D8C2F4 /* AppDelegate.m */,
197 | 3080633B1DDD59C500D8C2F4 /* main.m */,
198 | );
199 | name = "Supporting Files";
200 | sourceTree = "";
201 | };
202 | 308063561DDD59C500D8C2F4 /* 自定义相机UITests */ = {
203 | isa = PBXGroup;
204 | children = (
205 | 308063571DDD59C500D8C2F4 /* _____UITests.m */,
206 | 308063591DDD59C500D8C2F4 /* Info.plist */,
207 | );
208 | path = "自定义相机UITests";
209 | sourceTree = "";
210 | };
211 | 308063621DDD59FC00D8C2F4 /* libs */ = {
212 | isa = PBXGroup;
213 | children = (
214 | 306260AD1DEE7EEA00E35102 /* base */,
215 | 306260A51DEE7C4300E35102 /* IQEngUICamera.bundle */,
216 | 308063631DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.h */,
217 | 308063641DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.m */,
218 | 308063CA1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.h */,
219 | 308063CB1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.m */,
220 | 306260931DEBD07D00E35102 /* IQEngUIPhotoSessionView.h */,
221 | 306260941DEBD07D00E35102 /* IQEngUIPhotoSessionView.m */,
222 | 3062609C1DEC3A7500E35102 /* IQEngUIQRCodeView.h */,
223 | 3062609D1DEC3A7500E35102 /* IQEngUIQRCodeView.m */,
224 | );
225 | name = libs;
226 | sourceTree = "";
227 | };
228 | /* End PBXGroup section */
229 |
230 | /* Begin PBXNativeTarget section */
231 | 308063361DDD59C500D8C2F4 /* 自定义相机 */ = {
232 | isa = PBXNativeTarget;
233 | buildConfigurationList = 3080635C1DDD59C500D8C2F4 /* Build configuration list for PBXNativeTarget "自定义相机" */;
234 | buildPhases = (
235 | 308063331DDD59C500D8C2F4 /* Sources */,
236 | 308063341DDD59C500D8C2F4 /* Frameworks */,
237 | 308063351DDD59C500D8C2F4 /* Resources */,
238 | );
239 | buildRules = (
240 | );
241 | dependencies = (
242 | );
243 | name = "自定义相机";
244 | productName = "自定义相机";
245 | productReference = 308063371DDD59C500D8C2F4 /* 自定义相机.app */;
246 | productType = "com.apple.product-type.application";
247 | };
248 | 308063521DDD59C500D8C2F4 /* 自定义相机UITests */ = {
249 | isa = PBXNativeTarget;
250 | buildConfigurationList = 3080635F1DDD59C500D8C2F4 /* Build configuration list for PBXNativeTarget "自定义相机UITests" */;
251 | buildPhases = (
252 | 3080634F1DDD59C500D8C2F4 /* Sources */,
253 | 308063501DDD59C500D8C2F4 /* Frameworks */,
254 | 308063511DDD59C500D8C2F4 /* Resources */,
255 | );
256 | buildRules = (
257 | );
258 | dependencies = (
259 | 308063551DDD59C500D8C2F4 /* PBXTargetDependency */,
260 | );
261 | name = "自定义相机UITests";
262 | productName = "自定义相机UITests";
263 | productReference = 308063531DDD59C500D8C2F4 /* 自定义相机UITests.xctest */;
264 | productType = "com.apple.product-type.bundle.ui-testing";
265 | };
266 | /* End PBXNativeTarget section */
267 |
268 | /* Begin PBXProject section */
269 | 3080632F1DDD59C500D8C2F4 /* Project object */ = {
270 | isa = PBXProject;
271 | attributes = {
272 | LastUpgradeCheck = 1010;
273 | ORGANIZATIONNAME = Herson;
274 | TargetAttributes = {
275 | 308063361DDD59C500D8C2F4 = {
276 | CreatedOnToolsVersion = 8.0;
277 | DevelopmentTeam = 3B3Z5L9KTV;
278 | ProvisioningStyle = Automatic;
279 | };
280 | 308063521DDD59C500D8C2F4 = {
281 | CreatedOnToolsVersion = 8.0;
282 | DevelopmentTeam = 3B3Z5L9KTV;
283 | ProvisioningStyle = Automatic;
284 | TestTargetID = 308063361DDD59C500D8C2F4;
285 | };
286 | };
287 | };
288 | buildConfigurationList = 308063321DDD59C500D8C2F4 /* Build configuration list for PBXProject "自定义相机" */;
289 | compatibilityVersion = "Xcode 3.2";
290 | developmentRegion = English;
291 | hasScannedForEncodings = 0;
292 | knownRegions = (
293 | en,
294 | Base,
295 | );
296 | mainGroup = 3080632E1DDD59C500D8C2F4;
297 | productRefGroup = 308063381DDD59C500D8C2F4 /* Products */;
298 | projectDirPath = "";
299 | projectRoot = "";
300 | targets = (
301 | 308063361DDD59C500D8C2F4 /* 自定义相机 */,
302 | 308063521DDD59C500D8C2F4 /* 自定义相机UITests */,
303 | );
304 | };
305 | /* End PBXProject section */
306 |
307 | /* Begin PBXResourcesBuildPhase section */
308 | 308063351DDD59C500D8C2F4 /* Resources */ = {
309 | isa = PBXResourcesBuildPhase;
310 | buildActionMask = 2147483647;
311 | files = (
312 | 306260A61DEE7C4300E35102 /* IQEngUICamera.bundle in Resources */,
313 | 3080634D1DDD59C500D8C2F4 /* LaunchScreen.storyboard in Resources */,
314 | 3080634A1DDD59C500D8C2F4 /* Assets.xcassets in Resources */,
315 | 308063451DDD59C500D8C2F4 /* Main.storyboard in Resources */,
316 | );
317 | runOnlyForDeploymentPostprocessing = 0;
318 | };
319 | 308063511DDD59C500D8C2F4 /* Resources */ = {
320 | isa = PBXResourcesBuildPhase;
321 | buildActionMask = 2147483647;
322 | files = (
323 | );
324 | runOnlyForDeploymentPostprocessing = 0;
325 | };
326 | /* End PBXResourcesBuildPhase section */
327 |
328 | /* Begin PBXSourcesBuildPhase section */
329 | 308063331DDD59C500D8C2F4 /* Sources */ = {
330 | isa = PBXSourcesBuildPhase;
331 | buildActionMask = 2147483647;
332 | files = (
333 | 30760F751E77915800BA06B9 /* UIView+IQEngUICamera.m in Sources */,
334 | 308063651DDD5B8F00D8C2F4 /* IQEngUIAVCaptureSessionView_base.m in Sources */,
335 | 308067C51DE4157200D8C2F4 /* IQEngUIQRCodeViewController.m in Sources */,
336 | 3062609B1DEBE87100E35102 /* IQEngUIPhotoViewController.m in Sources */,
337 | 308063421DDD59C500D8C2F4 /* ViewController.m in Sources */,
338 | 306260A91DEE7C9A00E35102 /* NSBundle+IQEngUICamera.m in Sources */,
339 | 308063CC1DE2969100D8C2F4 /* IQEngUIQRCodeSessionView.m in Sources */,
340 | 308063481DDD59C500D8C2F4 /* _____.xcdatamodeld in Sources */,
341 | 306260AC1DEE7EE600E35102 /* UIImage+IQEngUICamera.m in Sources */,
342 | 3080633F1DDD59C500D8C2F4 /* AppDelegate.m in Sources */,
343 | 3062609E1DEC3A7500E35102 /* IQEngUIQRCodeView.m in Sources */,
344 | 3080633C1DDD59C500D8C2F4 /* main.m in Sources */,
345 | 30760F711E7790B600BA06B9 /* IQEngUIBackGroundView.m in Sources */,
346 | 306260951DEBD07D00E35102 /* IQEngUIPhotoSessionView.m in Sources */,
347 | 306260981DEBE6A900E35102 /* IQEngUIFaceViewController.m in Sources */,
348 | 30760F721E7790B600BA06B9 /* IQEngUIIDCardScanViewController.m in Sources */,
349 | );
350 | runOnlyForDeploymentPostprocessing = 0;
351 | };
352 | 3080634F1DDD59C500D8C2F4 /* Sources */ = {
353 | isa = PBXSourcesBuildPhase;
354 | buildActionMask = 2147483647;
355 | files = (
356 | 308063581DDD59C500D8C2F4 /* _____UITests.m in Sources */,
357 | );
358 | runOnlyForDeploymentPostprocessing = 0;
359 | };
360 | /* End PBXSourcesBuildPhase section */
361 |
362 | /* Begin PBXTargetDependency section */
363 | 308063551DDD59C500D8C2F4 /* PBXTargetDependency */ = {
364 | isa = PBXTargetDependency;
365 | target = 308063361DDD59C500D8C2F4 /* 自定义相机 */;
366 | targetProxy = 308063541DDD59C500D8C2F4 /* PBXContainerItemProxy */;
367 | };
368 | /* End PBXTargetDependency section */
369 |
370 | /* Begin PBXVariantGroup section */
371 | 308063431DDD59C500D8C2F4 /* Main.storyboard */ = {
372 | isa = PBXVariantGroup;
373 | children = (
374 | 308063441DDD59C500D8C2F4 /* Base */,
375 | );
376 | name = Main.storyboard;
377 | sourceTree = "";
378 | };
379 | 3080634B1DDD59C500D8C2F4 /* LaunchScreen.storyboard */ = {
380 | isa = PBXVariantGroup;
381 | children = (
382 | 3080634C1DDD59C500D8C2F4 /* Base */,
383 | );
384 | name = LaunchScreen.storyboard;
385 | sourceTree = "";
386 | };
387 | /* End PBXVariantGroup section */
388 |
389 | /* Begin XCBuildConfiguration section */
390 | 3080635A1DDD59C500D8C2F4 /* Debug */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | ALWAYS_SEARCH_USER_PATHS = NO;
394 | CLANG_ANALYZER_NONNULL = YES;
395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
396 | CLANG_CXX_LIBRARY = "libc++";
397 | CLANG_ENABLE_MODULES = YES;
398 | CLANG_ENABLE_OBJC_ARC = YES;
399 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
400 | CLANG_WARN_BOOL_CONVERSION = YES;
401 | CLANG_WARN_COMMA = YES;
402 | CLANG_WARN_CONSTANT_CONVERSION = YES;
403 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
405 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
406 | CLANG_WARN_EMPTY_BODY = YES;
407 | CLANG_WARN_ENUM_CONVERSION = YES;
408 | CLANG_WARN_INFINITE_RECURSION = YES;
409 | CLANG_WARN_INT_CONVERSION = YES;
410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
412 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
414 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
415 | CLANG_WARN_STRICT_PROTOTYPES = YES;
416 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
417 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
418 | CLANG_WARN_UNREACHABLE_CODE = YES;
419 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
421 | COPY_PHASE_STRIP = NO;
422 | DEBUG_INFORMATION_FORMAT = dwarf;
423 | ENABLE_STRICT_OBJC_MSGSEND = YES;
424 | ENABLE_TESTABILITY = YES;
425 | GCC_C_LANGUAGE_STANDARD = gnu99;
426 | GCC_DYNAMIC_NO_PIC = NO;
427 | GCC_NO_COMMON_BLOCKS = YES;
428 | GCC_OPTIMIZATION_LEVEL = 0;
429 | GCC_PREPROCESSOR_DEFINITIONS = (
430 | "DEBUG=1",
431 | "$(inherited)",
432 | );
433 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
434 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
435 | GCC_WARN_UNDECLARED_SELECTOR = YES;
436 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
437 | GCC_WARN_UNUSED_FUNCTION = YES;
438 | GCC_WARN_UNUSED_VARIABLE = YES;
439 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
440 | MTL_ENABLE_DEBUG_INFO = YES;
441 | ONLY_ACTIVE_ARCH = YES;
442 | SDKROOT = iphoneos;
443 | };
444 | name = Debug;
445 | };
446 | 3080635B1DDD59C500D8C2F4 /* Release */ = {
447 | isa = XCBuildConfiguration;
448 | buildSettings = {
449 | ALWAYS_SEARCH_USER_PATHS = NO;
450 | CLANG_ANALYZER_NONNULL = YES;
451 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
452 | CLANG_CXX_LIBRARY = "libc++";
453 | CLANG_ENABLE_MODULES = YES;
454 | CLANG_ENABLE_OBJC_ARC = YES;
455 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
456 | CLANG_WARN_BOOL_CONVERSION = YES;
457 | CLANG_WARN_COMMA = YES;
458 | CLANG_WARN_CONSTANT_CONVERSION = YES;
459 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
460 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
461 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
462 | CLANG_WARN_EMPTY_BODY = YES;
463 | CLANG_WARN_ENUM_CONVERSION = YES;
464 | CLANG_WARN_INFINITE_RECURSION = YES;
465 | CLANG_WARN_INT_CONVERSION = YES;
466 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
467 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
468 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
469 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
470 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
471 | CLANG_WARN_STRICT_PROTOTYPES = YES;
472 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
473 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
474 | CLANG_WARN_UNREACHABLE_CODE = YES;
475 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
476 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
477 | COPY_PHASE_STRIP = NO;
478 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
479 | ENABLE_NS_ASSERTIONS = NO;
480 | ENABLE_STRICT_OBJC_MSGSEND = YES;
481 | GCC_C_LANGUAGE_STANDARD = gnu99;
482 | GCC_NO_COMMON_BLOCKS = YES;
483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
485 | GCC_WARN_UNDECLARED_SELECTOR = YES;
486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
487 | GCC_WARN_UNUSED_FUNCTION = YES;
488 | GCC_WARN_UNUSED_VARIABLE = YES;
489 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
490 | MTL_ENABLE_DEBUG_INFO = NO;
491 | SDKROOT = iphoneos;
492 | VALIDATE_PRODUCT = YES;
493 | };
494 | name = Release;
495 | };
496 | 3080635D1DDD59C500D8C2F4 /* Debug */ = {
497 | isa = XCBuildConfiguration;
498 | buildSettings = {
499 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
500 | DEVELOPMENT_TEAM = 3B3Z5L9KTV;
501 | FRAMEWORK_SEARCH_PATHS = (
502 | "$(inherited)",
503 | "$(PROJECT_DIR)",
504 | );
505 | INFOPLIST_FILE = "自定义相机/Info.plist";
506 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
507 | PRODUCT_BUNDLE_IDENTIFIER = "HermaVista.-----";
508 | PRODUCT_NAME = "$(TARGET_NAME)";
509 | };
510 | name = Debug;
511 | };
512 | 3080635E1DDD59C500D8C2F4 /* Release */ = {
513 | isa = XCBuildConfiguration;
514 | buildSettings = {
515 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
516 | DEVELOPMENT_TEAM = 3B3Z5L9KTV;
517 | FRAMEWORK_SEARCH_PATHS = (
518 | "$(inherited)",
519 | "$(PROJECT_DIR)",
520 | );
521 | INFOPLIST_FILE = "自定义相机/Info.plist";
522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
523 | PRODUCT_BUNDLE_IDENTIFIER = "HermaVista.-----";
524 | PRODUCT_NAME = "$(TARGET_NAME)";
525 | };
526 | name = Release;
527 | };
528 | 308063601DDD59C500D8C2F4 /* Debug */ = {
529 | isa = XCBuildConfiguration;
530 | buildSettings = {
531 | DEVELOPMENT_TEAM = 3B3Z5L9KTV;
532 | INFOPLIST_FILE = "自定义相机UITests/Info.plist";
533 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
534 | PRODUCT_BUNDLE_IDENTIFIER = "HermaVista.-----UITests";
535 | PRODUCT_NAME = "$(TARGET_NAME)";
536 | TEST_TARGET_NAME = "自定义相机";
537 | };
538 | name = Debug;
539 | };
540 | 308063611DDD59C500D8C2F4 /* Release */ = {
541 | isa = XCBuildConfiguration;
542 | buildSettings = {
543 | DEVELOPMENT_TEAM = 3B3Z5L9KTV;
544 | INFOPLIST_FILE = "自定义相机UITests/Info.plist";
545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
546 | PRODUCT_BUNDLE_IDENTIFIER = "HermaVista.-----UITests";
547 | PRODUCT_NAME = "$(TARGET_NAME)";
548 | TEST_TARGET_NAME = "自定义相机";
549 | };
550 | name = Release;
551 | };
552 | /* End XCBuildConfiguration section */
553 |
554 | /* Begin XCConfigurationList section */
555 | 308063321DDD59C500D8C2F4 /* Build configuration list for PBXProject "自定义相机" */ = {
556 | isa = XCConfigurationList;
557 | buildConfigurations = (
558 | 3080635A1DDD59C500D8C2F4 /* Debug */,
559 | 3080635B1DDD59C500D8C2F4 /* Release */,
560 | );
561 | defaultConfigurationIsVisible = 0;
562 | defaultConfigurationName = Release;
563 | };
564 | 3080635C1DDD59C500D8C2F4 /* Build configuration list for PBXNativeTarget "自定义相机" */ = {
565 | isa = XCConfigurationList;
566 | buildConfigurations = (
567 | 3080635D1DDD59C500D8C2F4 /* Debug */,
568 | 3080635E1DDD59C500D8C2F4 /* Release */,
569 | );
570 | defaultConfigurationIsVisible = 0;
571 | defaultConfigurationName = Release;
572 | };
573 | 3080635F1DDD59C500D8C2F4 /* Build configuration list for PBXNativeTarget "自定义相机UITests" */ = {
574 | isa = XCConfigurationList;
575 | buildConfigurations = (
576 | 308063601DDD59C500D8C2F4 /* Debug */,
577 | 308063611DDD59C500D8C2F4 /* Release */,
578 | );
579 | defaultConfigurationIsVisible = 0;
580 | defaultConfigurationName = Release;
581 | };
582 | /* End XCConfigurationList section */
583 |
584 | /* Begin XCVersionGroup section */
585 | 308063461DDD59C500D8C2F4 /* _____.xcdatamodeld */ = {
586 | isa = XCVersionGroup;
587 | children = (
588 | 308063471DDD59C500D8C2F4 /* _____.xcdatamodel */,
589 | );
590 | currentVersion = 308063471DDD59C500D8C2F4 /* _____.xcdatamodel */;
591 | path = "_____.xcdatamodeld";
592 | sourceTree = "";
593 | versionGroupType = wrapper.xcdatamodel;
594 | };
595 | /* End XCVersionGroup section */
596 | };
597 | rootObject = 3080632F1DDD59C500D8C2F4 /* Project object */;
598 | }
599 |
--------------------------------------------------------------------------------