Permalink
Browse files

minor updates for Xcode 10

  • Loading branch information...
piemonte committed Dec 17, 2018
1 parent 2f43191 commit 7ce78a08b72c2d908cd0f03faf9bbef764b4fc3a
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -39,6 +39,11 @@ CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_INT_CONVERSION = YES
CLANG_WARN_BOOL_CONVERSION = YES
CLANG_WARN_INFINITE_RECURSION = YES
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
//CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;

GCC_ENABLE_OBJC_EXCEPTIONS = NO
ENABLE_STRICT_OBJC_MSGSEND = YES
@@ -332,7 +332,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = PBJ;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Patrick Piemonte";
TargetAttributes = {
0605279A1E3069DE005298D4 = {
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
@@ -95,8 +95,9 @@ - (id)initWithFrame:(CGRect)frame
- (void)start
{
_strobeViewRecord.alpha = 1;
__block __weak __typeof(self) me = self;
[UIView animateWithDuration:0.1f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
_strobeViewRecordIdle.transform = CGAffineTransformMakeScale(0, 0);
me._strobeViewRecordIdle.transform = CGAffineTransformMakeScale(0, 0);
} completion:^(BOOL finished) {
}];
}
@@ -106,8 +107,9 @@ - (void)stop
[_strobeViewRecord.layer removeAllAnimations];

_strobeViewRecord.alpha = 0;
__block __weak __typeof(self) me = self;
[UIView animateWithDuration:0.2f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
_strobeViewRecordIdle.transform = CGAffineTransformMakeScale(0.7f, 0.7f);
me._strobeViewRecordIdle.transform = CGAffineTransformMakeScale(0.7f, 0.7f);
} completion:^(BOOL finished) {
}];
}
@@ -445,9 +445,11 @@ - (void)setCameraDevice:(PBJCameraDevice)cameraDevice
- (void)setCaptureSessionPreset:(NSString *)captureSessionPreset
{
_captureSessionPreset = captureSessionPreset;
if ([_captureSession canSetSessionPreset:captureSessionPreset]){
if ([_captureSession canSetSessionPreset:captureSessionPreset]) {
__block __weak __typeof(self) me = self;
[self _commitBlock:^{
[_captureSession setSessionPreset:captureSessionPreset];
__typeof(self) strongMe = me;
[strongMe->_captureSession setSessionPreset:captureSessionPreset];
}];
}
}
@@ -707,7 +709,7 @@ - (id)init
_captureSessionDispatchQueue = dispatch_queue_create("PBJVisionSession", DISPATCH_QUEUE_SERIAL); // protects session
_captureCaptureDispatchQueue = dispatch_queue_create("PBJVisionCapture", DISPATCH_QUEUE_SERIAL); // protects capture

_previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:nil];
_previewLayer = [[AVCaptureVideoPreviewLayer alloc] init];

_maximumCaptureDuration = kCMTimeInvalid;

@@ -737,7 +739,7 @@ - (void)dealloc

#pragma mark - queue helper methods

typedef void (^PBJVisionBlock)();
typedef void (^PBJVisionBlock)(void);

- (void)_enqueueBlockOnCaptureSessionQueue:(PBJVisionBlock)block
{
@@ -1294,16 +1296,18 @@ - (void)_focusEnded
}
}

if ([_delegate respondsToSelector:@selector(visionDidStopFocus:)])
if ([_delegate respondsToSelector:@selector(visionDidStopFocus:)]) {
[_delegate visionDidStopFocus:self];
// DLog(@"focus ended");
}
// DLog(@"focus ended");
}

- (void)_exposureChangeStarted
{
// DLog(@"exposure change started");
if ([_delegate respondsToSelector:@selector(visionWillChangeExposure:)])
if ([_delegate respondsToSelector:@selector(visionWillChangeExposure:)]) {
[_delegate visionWillChangeExposure:self];
}
}

- (void)_exposureChangeEnded
@@ -1326,9 +1330,10 @@ - (void)_exposureChangeEnded

}

if ([_delegate respondsToSelector:@selector(visionDidChangeExposure:)])
if ([_delegate respondsToSelector:@selector(visionDidChangeExposure:)]) {
[_delegate visionDidChangeExposure:self];
// DLog(@"exposure change ended");
}
}

- (void)_whiteBalanceChangeStarted
@@ -2498,41 +2503,48 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
{
if ( context == (__bridge void *)PBJVisionFocusObserverContext ) {

BOOL isFocusing = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isFocusing) {
[self _focusStarted];
} else {
[self _focusEnded];
}

[self _enqueueBlockOnMainQueue:^{
BOOL isFocusing = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isFocusing) {
[self _focusStarted];
} else {
[self _focusEnded];
}
}];

}
else if ( context == (__bridge void *)PBJVisionExposureObserverContext ) {

BOOL isChangingExposure = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isChangingExposure) {
[self _exposureChangeStarted];
} else {
[self _exposureChangeEnded];
}
[self _enqueueBlockOnMainQueue:^{
BOOL isChangingExposure = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isChangingExposure) {
[self _exposureChangeStarted];
} else {
[self _exposureChangeEnded];
}
}];

}
else if ( context == (__bridge void *)PBJVisionWhiteBalanceObserverContext ) {

BOOL isWhiteBalanceChanging = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isWhiteBalanceChanging) {
[self _whiteBalanceChangeStarted];
} else {
[self _whiteBalanceChangeEnded];
}

[self _enqueueBlockOnMainQueue:^{
BOOL isWhiteBalanceChanging = [[change objectForKey:NSKeyValueChangeNewKey] boolValue];
if (isWhiteBalanceChanging) {
[self _whiteBalanceChangeStarted];
} else {
[self _whiteBalanceChangeEnded];
}
}];

}
else if ( context == (__bridge void *)PBJVisionFlashAvailabilityObserverContext ||
context == (__bridge void *)PBJVisionTorchAvailabilityObserverContext ) {

// DLog(@"flash/torch availability did change");
[self _enqueueBlockOnMainQueue:^{
if ([_delegate respondsToSelector:@selector(visionDidChangeFlashAvailablility:)])
if ([_delegate respondsToSelector:@selector(visionDidChangeFlashAvailablility:)]) {
[_delegate visionDidChangeFlashAvailablility:self];
}
}];

}
@@ -2541,8 +2553,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N

// DLog(@"flash/torch mode did change");
[self _enqueueBlockOnMainQueue:^{
if ([_delegate respondsToSelector:@selector(visionDidChangeFlashMode:)])
if ([_delegate respondsToSelector:@selector(visionDidChangeFlashMode:)]) {
[_delegate visionDidChangeFlashMode:self];
}
}];

}

0 comments on commit 7ce78a0

Please sign in to comment.