Last active
November 13, 2017 15:50
-
-
Save rpiwetz/f13f4cbaf083afe9aa2e1eac90815d47 to your computer and use it in GitHub Desktop.
Hyperloop NSArray sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MTBBarcodeScanner = require('MTBBarcodeScanner/MTBBarcodeScanner'); | |
var scanner = MTBBarcodeScanner.alloc().initWithPreviewView($.window); | |
MTBBarcodeScanner.requestCameraPermissionWithSuccess(function(success) { | |
if(success) { | |
Ti.API.log("success received"); | |
scanner.startScanningWithResultBlock(function(codes) { | |
for (var i = 0; i < codes.count; i++) { | |
Ti.API.log(codes.objectAtIndex(i).stringValue); | |
} | |
Ti.API.log("code: " + codes.count); | |
scanner.stopScanning(); | |
}); | |
} | |
else { | |
Ti.API.log("error received"); | |
} | |
}); | |
$.window.open(); |
Podfile contents:
install! 'cocoapods',
:integrate_targets => false
platform :ios, '8.0'
target 'HyperloopTest' do
pod 'MTBBarcodeScanner'
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
outputs:
<KrollCallback: 0x170271540>