-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAVCaptureImagePopoverViewControllerIOS.m
More file actions
91 lines (71 loc) · 2.34 KB
/
AVCaptureImagePopoverViewControllerIOS.m
File metadata and controls
91 lines (71 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#import "AVCaptureImagePopoverViewControllerIOS.h"
#if TARGET_OS_IPHONE
#import "AVCaptureStoryboardPopoverSegueIOS.h"
#import "UIApplication+Utilities.h"
@interface AVCaptureImagePopoverViewControllerIOS ()
@property (ARC_PROP_OUTLET) IBOutlet AVCaptureImageModel* outletCaptureVideoImageModel;
@property (ARC_PROP_OUTLET) IBOutlet AVCaptureImageModel* outletCaptureStillImageModel;
@property (ARC_PROP_OUTLET) IBOutlet AVCaptureImageController* outletCaptureImageController;
@end
@implementation AVCaptureImagePopoverViewControllerIOS
ARC_SYNTHESIZEOUTLET(outletCaptureStillImageModel);
ARC_SYNTHESIZEOUTLET(outletCaptureVideoImageModel);
ARC_SYNTHESIZEOUTLET(outletCaptureImageController);
- (instancetype) initWithCoder:(NSCoder *)coder
{
if ((self=[super initWithCoder:coder])!=nil)
{
self.preferredContentSize = [AVCaptureStoryboardPopoverSegueIOS preferredContentSize];
}
return self;
}
- (void) dealloc
{
if (REQUIRED_DEBUG(outletCaptureImageController!=nil) && outletCaptureImageController.captureTeardownNeeded)
{
[outletCaptureImageController captureTeardown];
}
ARC_SUPERDEALLOC(self);
}
- (void)captureController:(AVCaptureImageControllerBase*)controller outputCaptureImage:(AVCaptureImageModel*)image sampleBuffer:(CMSampleBufferRef)sampleBuffer
{
}
- (void) viewCaptureSetupIfNecessary{
if (REQUIRED_DEBUG(outletCaptureImageController!=nil))
if (outletCaptureImageController.captureSetupNeeded)
{
[outletCaptureImageController captureSetup];
}
}
- (void) viewCaptureTeardownIfNecessary{
if (REQUIRED_DEBUG(outletCaptureImageController!=nil))
{
if (outletCaptureImageController.captureTeardownNeeded)
[outletCaptureImageController captureTeardown];
}
}
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewDidAppear:(BOOL)animated {
[self viewCaptureSetupIfNecessary];
}
- (void)viewWillUnload {
[self viewCaptureTeardownIfNecessary];
}
-(void) prepareForSegue:(UIStoryboardSegue*)segue sender:(id)sender
{
NSLOG_METHOD(segue);
}
-(IBAction) actionSnapImageAndDismissController:(id)sender
{
if (REQUIRED_DEBUG(outletCaptureImageController!=nil))
[outletCaptureImageController actionCaptureSnapshot:sender];
if (REQUIRED_DEBUG(self.navigationController!=nil))
{
[self viewCaptureTeardownIfNecessary];
[self.navigationController popViewControllerAnimated:YES];
}
}
@end
#endif /* TARGET_OS_IPHONE */