天下虚怀接空谷,何处高峰不入云。
一、相机界面绘制需要的一些宏
#define kScreenBounds [UIScreen mainScreen].bounds
#define kPhotographWidth 100 //拍摄区域宽度
#define kPhotographHeight 400 //拍摄区域高度
#define kBackgroudColor [UIColor colorWithWhite:0 alpha:.7] //遮罩颜色
#define kTopBackgroudColor [UIColor colorWithWhite:0 alpha:.9] //遮罩颜色
#define kShadeTopHeight StatusBarAndNavigationBarHeight//导航栏高度
#define kShadeBottomHeight 84//底部拍摄按钮高度
#define kTopHeight ((SCREEN_HEIGHT-kPhotographHeight-kShadeTopHeight-kShadeBottomHeight)/2)
#define kLeftWidth ((SCREEN_WIDTH-kPhotographWidth)/2)
typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);
二、属性的申明
@property (nonatomic,strong)AVCaptureDevice* device;
@property (nonatomic,strong)AVCaptureStillImageOutput *ImageOutPut;
@property (nonatomic,strong)AVCaptureSession *session;
@property (nonatomic,strong)AVCaptureDeviceInput* input;
@property (strong,nonatomic) UIImageView *focusCursor; //聚焦光标
三、正文开始
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:YES];
if (self.session) {
[self.session stopRunning];
}