-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MOD-2354] : Replace XZing library with AVFoundation framework #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few changes. In general: NICE!
ios/Classes/TiBarcodeModule.h
Outdated
TiBarcodeViewController *barcodeViewController; | ||
MTBCamera selectedCamera; | ||
MTBTorchMode selectedLEDMode; | ||
NSString *displayedMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please prefix all private properties with _
.
@property(nonatomic,readonly) NSNumber *FORMAT_EAN_13; | ||
@property(nonatomic,readonly) NSNumber *FORMAT_CODE_128; | ||
@property(nonatomic,readonly) NSNumber *FORMAT_CODE_39; | ||
@property(nonatomic,readonly) NSNumber *FORMAT_ITF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we support all of these constants I assume?
ios/Classes/TiBarcodeModule.h
Outdated
@property(nonatomic,readonly) NSNumber *FORMAT_CODE_128; | ||
@property(nonatomic,readonly) NSNumber *FORMAT_CODE_39; | ||
@property(nonatomic,readonly) NSNumber *FORMAT_ITF; | ||
- (id)canShow:(id)unused; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSNumber *
ios/Classes/TiBarcodeModule.h
Outdated
|
||
- (void)setUseLED:(id)value; | ||
|
||
- (id)useLED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSNumber *
ios/Classes/TiBarcodeModule.h
Outdated
|
||
- (void)cancel:(id)unused; | ||
|
||
- (void)setUseLED:(id)value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSNumber *
ios/Classes/TiBarcodeModule.m
Outdated
|
||
- (id)canShow:(id)unused | ||
{ | ||
return NUMBOOL([MTBBarcodeScanner cameraIsPresent] && ![MTBBarcodeScanner scanningIsProhibited]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I start moving to @(value)
instead of NUM***
.
withObject:@{ | ||
@"message" : [error localizedDescription] ?: @"Unknown error occurred." | ||
}]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks weird. Did you format this?
ios/Classes/TiBarcodeModule.m
Outdated
|
||
selectedLEDMode = [TiUtils boolValue:value def:YES] ? MTBTorchModeOn : MTBTorchModeOff; | ||
|
||
if (barcodeViewController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always compare against nil, since barcodeViewController
is not a boolean.
ios/Classes/TiBarcodeModule.m
Outdated
[self replaceValue:value forKey:@"useFrontCamera" notification:NO]; | ||
|
||
selectedCamera = [TiUtils boolValue:value def:YES] ? MTBCameraFront : MTBCameraBack; | ||
NSError *cameraError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize with nil
ios/Classes/TiBarcodeModule.m
Outdated
{ | ||
ENSURE_SINGLE_ARG(args, NSDictionary); | ||
|
||
id blob = [args valueForKey:@"image"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to prevent id
whereever possible. Use TiBlob
for this case and change all other id's if possible as well.
@hansemannn Addressed the comments. Please review. Thanks! |
https://jira.appcelerator.org/browse/MOD-2354
Download: v2.0.0 Beta