Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
heart committed Sep 28, 2020
2 parents dae98fb + 7a9d900 commit 4c1c711
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
26 changes: 17 additions & 9 deletions ExampleProject/ExampleProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
3EC5EF8523C447EE0063A687 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3EC5EF8423C447EE0063A687 /* Preview Assets.xcassets */; };
3EC5EF8823C447EE0063A687 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3EC5EF8623C447EE0063A687 /* LaunchScreen.storyboard */; };
3EC5EF9223C448A20063A687 /* ModalScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC5EF9123C448A20063A687 /* ModalScannerView.swift */; };
4FF401D4251BBE5200C3F227 /* CarBode in Frameworks */ = {isa = PBXBuildFile; productRef = 4FF401D3251BBE5200C3F227 /* CarBode */; };
4F737D9E2521C39F002E36F3 /* CarBode in Frameworks */ = {isa = PBXBuildFile; productRef = 4F737D9D2521C39F002E36F3 /* CarBode */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -36,7 +36,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4FF401D4251BBE5200C3F227 /* CarBode in Frameworks */,
4F737D9E2521C39F002E36F3 /* CarBode in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -48,6 +48,7 @@
children = (
3EC5EF7A23C447EA0063A687 /* ExampleProject */,
3EC5EF7923C447EA0063A687 /* Products */,
4FE393DE2521C1FD007165D3 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -83,6 +84,13 @@
path = "Preview Content";
sourceTree = "<group>";
};
4FE393DE2521C1FD007165D3 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -100,7 +108,7 @@
);
name = ExampleProject;
packageProductDependencies = (
4FF401D3251BBE5200C3F227 /* CarBode */,
4F737D9D2521C39F002E36F3 /* CarBode */,
);
productName = ExampleProject;
productReference = 3EC5EF7823C447EA0063A687 /* ExampleProject.app */;
Expand Down Expand Up @@ -131,7 +139,7 @@
);
mainGroup = 3EC5EF6F23C447EA0063A687;
packageReferences = (
4FF401D2251BBE5200C3F227 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */,
4F737D9C2521C39F002E36F3 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */,
);
productRefGroup = 3EC5EF7923C447EA0063A687 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -360,20 +368,20 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
4FF401D2251BBE5200C3F227 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */ = {
4F737D9C2521C39F002E36F3 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI";
repositoryURL = "https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI/";
requirement = {
branch = develop;
branch = master;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
4FF401D3251BBE5200C3F227 /* CarBode */ = {
4F737D9D2521C39F002E36F3 /* CarBode */ = {
isa = XCSwiftPackageProductDependency;
package = 4FF401D2251BBE5200C3F227 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */;
package = 4F737D9C2521C39F002E36F3 /* XCRemoteSwiftPackageReference "CarBode-Barcode-Scanner-For-SwiftUI" */;
productName = CarBode;
};
/* End XCSwiftPackageProductDependency section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"pins": [
{
"package": "CarBode",
"repositoryURL": "https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI",
"repositoryURL": "https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI/",
"state": {
"branch": "develop",
"revision": "dd2a019124b27cdd56f248277a85e34bf598aa76",
"branch": "master",
"revision": "dae98fbf72430573e3c1818e9efbcf3eba4aac47",
"version": null
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The preferred way of installing SwiftUIX is via the [Swift Package Manager](http
1. In Xcode, open your project and navigate to **File****Swift Packages****Add Package Dependency...**
2. Paste the repository URL (`https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI`) and click **Next**.
3. For **Rules**, select **Branch** (with branch set to `1.5.0` ).
3. For **Rules**, select **Branch** (with branch set to `2.0.1` ).
4. Click **Finish**.

# Example project
Expand Down
17 changes: 9 additions & 8 deletions Sources/CarBode/CBScanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@
import SwiftUI
import AVFoundation

typealias OnFound = (BarcodeData)->Void


public struct CBScanner: UIViewRepresentable {

public typealias OnFound = (BarcodeData)->Void
public typealias UIViewType = CameraPreview

@Binding
var supportBarcode: [AVMetadataObject.ObjectType]
public var supportBarcode: [AVMetadataObject.ObjectType]

@Binding
var torchLightIsOn:Bool
public var torchLightIsOn:Bool

@Binding
var scanInterval: Double
public var scanInterval: Double

@Binding
var cameraPosition:AVCaptureDevice.Position
public var cameraPosition:AVCaptureDevice.Position

@Binding
var mockBarCode: BarcodeData
public var mockBarCode: BarcodeData

var onFound: OnFound?
public var onFound: OnFound?

init(supportBarcode:Binding<[AVMetadataObject.ObjectType]> ,
public init(supportBarcode:Binding<[AVMetadataObject.ObjectType]> ,
torchLightIsOn: Binding<Bool> = .constant(false),
scanInterval: Binding<Double> = .constant(3.0),
cameraPosition: Binding<AVCaptureDevice.Position> = .constant(.back),
Expand Down
2 changes: 1 addition & 1 deletion Sources/CarBode/CameraPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CameraPreview: UIView {
var scanInterval: Double = 3.0
var lastTime = Date(timeIntervalSince1970: 0)

var onFound: OnFound?
var onFound: CBScanner.OnFound?
var mockBarCode: BarcodeData?
var selectedCamera: AVCaptureDevice?

Expand Down

0 comments on commit 4c1c711

Please sign in to comment.