Skip to content

Commit

Permalink
Create individual Scanner and Review image controller (#213)
Browse files Browse the repository at this point in the history
* Set my profile of sign for test run and try to add new camera scanner view controller.

* Changed new camera scanner view controller.

* Try implement new camera scanner.

* Added new edit image view controller.

* Added crop function and delegate to send image back to subscription view controller.

* Fixed no delegate var.

* Added example implement of edit and review image.

* Changed bundle id back to We transfer.

* Roll back info.plist

* Merge develop to master

* Rollback to final class

* Removed optional image param of delegate function.

* Fixed method doesn't conform protocol.

* Fixed syntax follow SwiftLint rules.

* Fixed syntax follow SwiftLint rules.

* Renamed of sample project files. Changed button title name from 'new' to 'a new scan'

* Removed file out.

* Fixed syntax follow SwiftLint rules.

* update sub project comit.

* Merge from wetranfer:master

* Added rotate function on edit image view.

* Fixed detail of files.

* Fixed wrong date format.

* Added public comment for edit image view controller class.

* Fixed wrong date format.

* Added description of public camera scanner view controller.

* Fixed wrong rotate image and re-init zoom view controller.

* Remove universal variable.

* Added how to set corner and rect line color.
Added another default value of quad view to cover full image screen.

* update CI

* Added final class instead.

* update CI

* Added can setup auto scan from outside.

* Use toggle function instead

* Fixed comment of public edit image view protocol.

Co-authored-by: Chawatvish Worrapoj <[email protected]>
  • Loading branch information
chawatvish and Chawatvish Worrapoj authored Jul 22, 2020
1 parent 770cc71 commit a265d33
Show file tree
Hide file tree
Showing 13 changed files with 760 additions and 30 deletions.
56 changes: 42 additions & 14 deletions WeScan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

/* Begin PBXBuildFile section */
362967782294C23700B9FC4A /* CGImagePropertyOrientation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 362967772294C23700B9FC4A /* CGImagePropertyOrientation.swift */; };
382D0B0323C348A800A81619 /* CameraScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 382D0B0223C348A800A81619 /* CameraScannerViewController.swift */; };
383C440E23C5846B0070DE47 /* EditImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 383C440D23C5846B0070DE47 /* EditImageViewController.swift */; };
383C441723C587B90070DE47 /* ReviewImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 383C441623C587B90070DE47 /* ReviewImageViewController.swift */; };
388A3BF423C46DAE00263DD1 /* NewCameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 388A3BF323C46DAE00263DD1 /* NewCameraViewController.swift */; };
388A3BFD23C46FF000263DD1 /* EditImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 388A3BFC23C46FF000263DD1 /* EditImageViewController.swift */; };
74E27858215446C900361812 /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74E27850215446C200361812 /* FBSnapshotTestCase.framework */; };
74F7D034211ACBD90046AF7E /* CIRectangleDetectorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F7D033211ACBD90046AF7E /* CIRectangleDetectorTests.swift */; };
74F7D036211ACBEE0046AF7E /* CaptureSessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F7D035211ACBEE0046AF7E /* CaptureSessionTests.swift */; };
Expand Down Expand Up @@ -187,6 +192,11 @@
/* Begin PBXFileReference section */
274DF35922D363BC0095CE49 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; };
362967772294C23700B9FC4A /* CGImagePropertyOrientation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGImagePropertyOrientation.swift; sourceTree = "<group>"; };
382D0B0223C348A800A81619 /* CameraScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraScannerViewController.swift; sourceTree = "<group>"; };
383C440D23C5846B0070DE47 /* EditImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditImageViewController.swift; sourceTree = "<group>"; };
383C441623C587B90070DE47 /* ReviewImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewImageViewController.swift; sourceTree = "<group>"; };
388A3BF323C46DAE00263DD1 /* NewCameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewCameraViewController.swift; sourceTree = "<group>"; };
388A3BFC23C46FF000263DD1 /* EditImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditImageViewController.swift; sourceTree = "<group>"; };
37DE11D92417FC8A0062E4E4 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
4A644E2221A73C2B00B20839 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
731898DA243A753C00EA7356 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -385,6 +395,9 @@
A1D4BCC1202C4F3800FCDDEC /* Assets.xcassets */,
A1D4BCC3202C4F3800FCDDEC /* LaunchScreen.storyboard */,
A1D4BCC6202C4F3800FCDDEC /* Info.plist */,
388A3BF323C46DAE00263DD1 /* NewCameraViewController.swift */,
383C440D23C5846B0070DE47 /* EditImageViewController.swift */,
383C441623C587B90070DE47 /* ReviewImageViewController.swift */,
);
path = WeScanSampleProject;
sourceTree = "<group>";
Expand Down Expand Up @@ -478,18 +491,20 @@
A1F22ECF203199E7001723AD /* Scan */ = {
isa = PBXGroup;
children = (
A1D4BD0B202C504F00FCDDEC /* ScannerViewController.swift */,
382D0B0223C348A800A81619 /* CameraScannerViewController.swift */,
A1D4BD0D202C57A400FCDDEC /* CaptureSessionManager.swift */,
B9AAE88A219E6C0400205620 /* FocusRectangleView.swift */,
A1F22EA2202DAA74001723AD /* RectangleFeaturesFunnel.swift */,
A1D4BD0B202C504F00FCDDEC /* ScannerViewController.swift */,
A165F67D2044741B002D5ED6 /* ShutterButton.swift */,
B9AAE88A219E6C0400205620 /* FocusRectangleView.swift */,
);
path = Scan;
sourceTree = "<group>";
};
A1F22ED020319A03001723AD /* Edit */ = {
isa = PBXGroup;
children = (
388A3BFC23C46FF000263DD1 /* EditImageViewController.swift */,
A1F22ECD2031937E001723AD /* EditScanViewController.swift */,
C31DD8A220C087D80072D439 /* ZoomGestureController.swift */,
);
Expand Down Expand Up @@ -644,12 +659,12 @@
A1D4BCB6202C4F3800FCDDEC = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
};
A1D4BCEC202C4F4100FCDDEC = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
ProvisioningStyle = Manual;
};
A1D4BCF4202C4F4100FCDDEC = {
CreatedOnToolsVersion = 9.2;
Expand Down Expand Up @@ -848,7 +863,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
383C440E23C5846B0070DE47 /* EditImageViewController.swift in Sources */,
383C441723C587B90070DE47 /* ReviewImageViewController.swift in Sources */,
A1D4BCBD202C4F3800FCDDEC /* HomeViewController.swift in Sources */,
388A3BF423C46DAE00263DD1 /* NewCameraViewController.swift in Sources */,
A1D4BCBB202C4F3800FCDDEC /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -865,8 +883,10 @@
A1F22ECE2031937E001723AD /* EditScanViewController.swift in Sources */,
A1F22E9F202C8D70001723AD /* Quadrilateral.swift in Sources */,
A1DF90E420358CB100841A11 /* Transformable.swift in Sources */,
388A3BFD23C46FF000263DD1 /* EditImageViewController.swift in Sources */,
B9253F3F22190B7400C5DE7C /* CGSize+Utils.swift in Sources */,
A1D4BD0C202C504F00FCDDEC /* ScannerViewController.swift in Sources */,
382D0B0323C348A800A81619 /* CameraScannerViewController.swift in Sources */,
A11C5B9C2046A20C005075FE /* Error.swift in Sources */,
B940E3DE21AE2A79003B3C0B /* CaptureSession+Focus.swift in Sources */,
8A1BB199249C9B45000278F2 /* UIImage+SFSymbol.swift in Sources */,
Expand Down Expand Up @@ -1099,13 +1119,15 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7P4LQNMZS5;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = WeScanSampleProject/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.WeTransfer.WeScanSampleProject;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -1116,13 +1138,15 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7P4LQNMZS5;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = WeScanSampleProject/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.WeTransfer.WeScanSampleProject;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
Expand All @@ -1132,11 +1156,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 74N8K5J2N7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1146,6 +1170,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = WeTransfer.WeScan;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -1159,11 +1185,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 74N8K5J2N7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1173,6 +1199,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = WeTransfer.WeScan;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
7 changes: 7 additions & 0 deletions WeScan/Common/EditScanCornerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ final class EditScanCornerView: UIView {
layer.lineWidth = 1.0
return layer
}()

/// Set stroke color of coner layer
public var strokeColor: CGColor? {
didSet {
circleLayer.strokeColor = strokeColor
}
}

init(frame: CGRect, position: CornerPosition) {
self.position = position
Expand Down
11 changes: 11 additions & 0 deletions WeScan/Common/QuadrilateralView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ final class QuadrilateralView: UIView {
layoutCornerViews(forQuad: quad)
}
}

/// Set stroke color of image rect and coner.
public var strokeColor: CGColor? {
didSet {
quadLayer.strokeColor = strokeColor
topLeftCornerView.strokeColor = strokeColor
topRightCornerView.strokeColor = strokeColor
bottomRightCornerView.strokeColor = strokeColor
bottomLeftCornerView.strokeColor = strokeColor
}
}

private var isHighlighted = false {
didSet (oldValue) {
Expand Down
Loading

0 comments on commit a265d33

Please sign in to comment.