Skip to content

Commit

Permalink
Merge pull request #12 from hyperoslo/fix/type
Browse files Browse the repository at this point in the history
Add type info
  • Loading branch information
vadymmarkov committed Aug 6, 2016
2 parents 92a7416 + b44bb3b commit c6d71c1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
isa = PBXNativeTarget;
buildConfigurationList = D50BE4071C9FE8870000A34C /* Build configuration list for PBXNativeTarget "BarcodeScannerExample" */;
buildPhases = (
36F8214472FD1CA639982CE8 /* 📦 Check Pods Manifest.lock */,
36F8214472FD1CA639982CE8 /* [CP] Check Pods Manifest.lock */,
D50BE3F11C9FE8870000A34C /* Sources */,
D50BE3F21C9FE8870000A34C /* Frameworks */,
D50BE3F31C9FE8870000A34C /* Resources */,
E090C912AA824DD28A310598 /* 📦 Embed Pods Frameworks */,
B23721B8976E46E75F5C472C /* 📦 Copy Pods Resources */,
E090C912AA824DD28A310598 /* [CP] Embed Pods Frameworks */,
B23721B8976E46E75F5C472C /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -120,6 +120,7 @@
TargetAttributes = {
D50BE3F41C9FE8870000A34C = {
CreatedOnToolsVersion = 7.2.1;
DevelopmentTeam = LG4DBY4QF9;
};
};
};
Expand Down Expand Up @@ -154,44 +155,44 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
36F8214472FD1CA639982CE8 /* 📦 Check Pods Manifest.lock */ = {
36F8214472FD1CA639982CE8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
B23721B8976E46E75F5C472C /* 📦 Copy Pods Resources */ = {
B23721B8976E46E75F5C472C /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BarcodeScannerExample/Pods-BarcodeScannerExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E090C912AA824DD28A310598 /* 📦 Embed Pods Frameworks */ = {
E090C912AA824DD28A310598 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -311,10 +312,13 @@
baseConfigurationReference = 560D7A8F00215E8F16A67009 /* Pods-BarcodeScannerExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = BarcodeScannerExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample;
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Debug;
};
Expand All @@ -323,10 +327,13 @@
baseConfigurationReference = B2BB8B30EF0245DC64F4025A /* Pods-BarcodeScannerExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = BarcodeScannerExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample;
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.BarcodeScannerExample2;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class ViewController: UIViewController {

extension ViewController: BarcodeScannerCodeDelegate {

func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String) {
func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String, type: String) {
print(code)
print(type)

let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(6 * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
Expand Down
2 changes: 1 addition & 1 deletion Example/BarcodeScannerExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 5ef23317899e015b0a239f469648c11cbee75aaa

COCOAPODS: 1.0.0.beta.5
COCOAPODS: 1.0.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Use `BarcodeScannerCodeDelegate` when you want to get the captured code back.
```swift
extension ViewController: BarcodeScannerCodeDelegate {

func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String) {
func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String, type: String) {
print(code)
controller.reset()
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/BarcodeScannerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AVFoundation

/// Delegate to handle the captured code.
public protocol BarcodeScannerCodeDelegate: class {
func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String)
func barcodeScanner(controller: BarcodeScannerController, didCapturedCode code: String, type: String)
}

/// Delegate to report errors.
Expand Down Expand Up @@ -430,7 +430,7 @@ extension BarcodeScannerController: AVCaptureMetadataOutputObjectsDelegate {
}

animateFlash(oneTimeSearch)
codeDelegate?.barcodeScanner(self, didCapturedCode: code)
codeDelegate?.barcodeScanner(self, didCapturedCode: code, type: metadataObj.type)
}
}

Expand Down

0 comments on commit c6d71c1

Please sign in to comment.