Skip to content

Commit

Permalink
refactor: update CropToolbarDelegate and remove warnings (#384)
Browse files Browse the repository at this point in the history
* refactor: update CropToolbarProtocol

remove toolbarDelegate in EmbededCropViewController

* refactor: remove warnings

* chore: stop supporting iOS 11.0

remove more warnings

* chore: restore public init for Transformation
  • Loading branch information
guoyingtao committed Mar 25, 2024
1 parent 9a1e67a commit 1c25b09
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 95 deletions.
1 change: 0 additions & 1 deletion Example/AppDelegate.swift
Expand Up @@ -58,7 +58,6 @@ extension AppDelegate {
input: "z",
modifierFlags: [.command])


// Redo
let redoCommand = UIKeyCommand(title: "Redo",
action: #selector(EmbeddedCropViewController.redoButtonPressed(_:)),
Expand Down
20 changes: 7 additions & 13 deletions Example/EmbeddedCropViewController.swift
Expand Up @@ -14,8 +14,6 @@ class EmbeddedCropViewController: UIViewController {
var image: UIImage?
var cropViewController: CropViewController?

weak var toolbarDelegate: CropToolbarDelegate?

var didGetCroppedImage: ((UIImage) -> Void)?

@IBOutlet weak var cancelButton: UIBarButtonItem!
Expand Down Expand Up @@ -46,11 +44,11 @@ class EmbeddedCropViewController: UIViewController {
}

@IBAction func undoButtonPressed(_ sender: Any) {
toolbarDelegate?.didSelectUndo()
cropViewController?.didSelectUndo()
}

@IBAction func redoButtonPressed(_ sender: Any) {
toolbarDelegate?.didSelectRedo()
cropViewController?.didSelectRedo()
}

@IBAction func resetButtonPressed(_ sender: Any) {
Expand Down Expand Up @@ -81,7 +79,6 @@ class EmbeddedCropViewController: UIViewController {
Mantis.setupCropViewController(cropViewController, with: image, and: config)

self.cropViewController = cropViewController
self.toolbarDelegate = cropViewController
}

private func getResolution(image: UIImage?) -> String? {
Expand All @@ -97,25 +94,23 @@ class EmbeddedCropViewController: UIViewController {
action == #selector(EmbeddedCropViewController.redoButtonPressed(_:)) ||
action == #selector(EmbeddedCropViewController.resetButtonPressed(_:)) {

guard let toolbarDelegate = toolbarDelegate else { return false }

return toolbarDelegate.isUndoSupported()
return cropViewController!.isUndoSupported()
}

return true
}

override func validate(_ command: UICommand) {

guard let toolbarDelegate = toolbarDelegate else { return }
guard let cropViewController else { return }

if toolbarDelegate.isUndoSupported() {
if cropViewController.isUndoSupported() {

if command.action == #selector(EmbeddedCropViewController.undoButtonPressed(_:)) {

let undoString = NSLocalizedString("Undo", comment: "Undo")

command.title = self.undoButton.isEnabled ? "\(undoString) \(toolbarDelegate.undoActionName())" : undoString
command.title = self.undoButton.isEnabled ? "\(undoString) \(cropViewController.undoActionName())" : undoString

if !self.undoButton.isEnabled {
command.attributes = [.disabled]
Expand All @@ -126,7 +121,7 @@ class EmbeddedCropViewController: UIViewController {

let redoString = NSLocalizedString("Redo", comment: "Redo")

command.title = self.redoButton.isEnabled ? "\(redoString) \(toolbarDelegate.redoActionName())" : redoString
command.title = self.redoButton.isEnabled ? "\(redoString) \(cropViewController.redoActionName())" : redoString

if !self.redoButton.isEnabled {
command.attributes = [.disabled]
Expand Down Expand Up @@ -181,4 +176,3 @@ extension EmbeddedCropViewController: CropViewControllerDelegate {
self.resolutionLabel.text = "\(Int(size.width)) x \(Int(size.height)) pixels"
}
}

36 changes: 18 additions & 18 deletions Example/MantisExample.xcodeproj/project.pbxproj
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
3E5A418D8A9C14BAF7DD36AE /* libPods-MantisExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9A44CC9D29500B4D273713B /* libPods-MantisExampleTests.a */; };
400EDDBCCA9845FE75EE819D /* Pods_MantisExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12CF216417113B7016C51B96 /* Pods_MantisExample.framework */; };
5F0852B5237918510031B75D /* ImagePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F0852B4237918510031B75D /* ImagePicker.swift */; };
5FC10B15217A9EDF00582874 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC10B14217A9EDF00582874 /* AppDelegate.swift */; };
5FC10B17217A9EDF00582874 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FC10B16217A9EDF00582874 /* ViewController.swift */; };
Expand All @@ -19,8 +19,8 @@
5FEBA88221961E4A0018DE62 /* EmbeddedCropViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FEBA88121961E4A0018DE62 /* EmbeddedCropViewController.swift */; };
66F909BD287B601A007E2FC6 /* MyNavigationCropToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F909BC287B601A007E2FC6 /* MyNavigationCropToolbar.swift */; };
85DDBACD298E5A54004FBFE7 /* CustomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85DDBACC298E5A54004FBFE7 /* CustomViewController.swift */; };
9584621CBB178C95456D3612 /* libPods-MantisExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B1CAEE435A112962971BBC20 /* libPods-MantisExample.a */; };
CCBF2F602525B3050081B8FE /* CustomizedCropToolbarWithoutList.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCBF2F5F2525B3050081B8FE /* CustomizedCropToolbarWithoutList.swift */; };
D3F0CC0EBFCD7968170A98D3 /* Pods_MantisExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5010346E303DA6E138E2528F /* Pods_MantisExampleTests.framework */; };
F24DCFE529A8FA7F00D8E8C1 /* CustomWaitingIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24DCFE429A8FA7F00D8E8C1 /* CustomWaitingIndicator.swift */; };
/* End PBXBuildFile section */

Expand All @@ -35,7 +35,9 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
12CF216417113B7016C51B96 /* Pods_MantisExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MantisExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3FC821D838EDAC646C860226 /* Pods-MantisExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MantisExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-MantisExampleTests/Pods-MantisExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5010346E303DA6E138E2528F /* Pods_MantisExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MantisExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5F0852B4237918510031B75D /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; };
5F21BBB22448036100B7B0C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
5F21BBB32448036100B7B0C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -57,9 +59,7 @@
85DDBACC298E5A54004FBFE7 /* CustomViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomViewController.swift; sourceTree = "<group>"; };
89C5370690AB91AB238B90E9 /* Pods-MantisExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MantisExample.release.xcconfig"; path = "Target Support Files/Pods-MantisExample/Pods-MantisExample.release.xcconfig"; sourceTree = "<group>"; };
9326C1CDF121300C5CAAE2BE /* Pods-MantisExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MantisExample.debug.xcconfig"; path = "Target Support Files/Pods-MantisExample/Pods-MantisExample.debug.xcconfig"; sourceTree = "<group>"; };
B1CAEE435A112962971BBC20 /* libPods-MantisExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MantisExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
CCBF2F5F2525B3050081B8FE /* CustomizedCropToolbarWithoutList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomizedCropToolbarWithoutList.swift; sourceTree = "<group>"; };
D9A44CC9D29500B4D273713B /* libPods-MantisExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MantisExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F24DCFE429A8FA7F00D8E8C1 /* CustomWaitingIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomWaitingIndicator.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -68,15 +68,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9584621CBB178C95456D3612 /* libPods-MantisExample.a in Frameworks */,
400EDDBCCA9845FE75EE819D /* Pods_MantisExample.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5FC10B22217A9EE100582874 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3E5A418D8A9C14BAF7DD36AE /* libPods-MantisExampleTests.a in Frameworks */,
D3F0CC0EBFCD7968170A98D3 /* Pods_MantisExampleTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -86,8 +86,8 @@
5F3BE15921993A7C005C4BD8 /* Frameworks */ = {
isa = PBXGroup;
children = (
B1CAEE435A112962971BBC20 /* libPods-MantisExample.a */,
D9A44CC9D29500B4D273713B /* libPods-MantisExampleTests.a */,
12CF216417113B7016C51B96 /* Pods_MantisExample.framework */,
5010346E303DA6E138E2528F /* Pods_MantisExampleTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -156,7 +156,7 @@
5FC10B0D217A9EDF00582874 /* Sources */,
5FC10B0E217A9EDF00582874 /* Frameworks */,
5FC10B0F217A9EDF00582874 /* Resources */,
0EA6FA8883379671AEAFBD66 /* [CP] Copy Pods Resources */,
1E61E7730599A9D7AF36C55B /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -270,21 +270,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
0EA6FA8883379671AEAFBD66 /* [CP] Copy Pods Resources */ = {
1E61E7730599A9D7AF36C55B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MantisExample/Pods-MantisExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B990B0C0191568D739FE220D /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -494,11 +494,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = MantisExample.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = Z9GT6JU7N2;
DEVELOPMENT_TEAM = 3V26Q55U3S;
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -520,11 +520,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = MantisExample.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = Z9GT6JU7N2;
DEVELOPMENT_TEAM = 3V26Q55U3S;
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
2 changes: 1 addition & 1 deletion Mantis.podspec
Expand Up @@ -21,7 +21,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/guoyingtao"
s.platform = :ios
s.swift_version = "5.0"
s.ios.deployment_target = "11.0"
s.ios.deployment_target = "12.0"
s.source = { :git => "https://github.com/guoyingtao/Mantis.git", :tag => "v#{s.version}" }
s.source_files = "Sources/**/*.{h,swift}"
s.resource_bundles = {
Expand Down
25 changes: 16 additions & 9 deletions Mantis.xcodeproj/project.pbxproj
Expand Up @@ -604,8 +604,9 @@
OBJ_1 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftMigration = 9999;
LastUpgradeCheck = 1340;
LastUpgradeCheck = 1520;
TargetAttributes = {
8EFB6F5325D16A9E00C0DDB2 = {
CreatedOnToolsVersion = 12.4;
Expand Down Expand Up @@ -884,6 +885,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Sources/Mantis/Resources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.echo.framework.Mantis;
Expand Down Expand Up @@ -919,6 +921,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Sources/Mantis/Resources/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.echo.framework.Mantis;
Expand All @@ -933,7 +936,7 @@
OBJ_105 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "";
DEVELOPMENT_TEAM = Z9GT6JU7N2;
LD = /usr/bin/true;
OTHER_SWIFT_FLAGS = "-swift-version 5 -I $(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -package-description-version 5.1";
Expand All @@ -947,7 +950,7 @@
OBJ_106 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "";
DEVELOPMENT_TEAM = Z9GT6JU7N2;
LD = /usr/bin/true;
OTHER_SWIFT_FLAGS = "-swift-version 5 -I $(TOOLCHAIN_DIR)/usr/lib/swift/pm/4_2 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -package-description-version 5.1";
Expand Down Expand Up @@ -1062,6 +1065,7 @@
ENABLE_NS_ASSERTIONS = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -1075,7 +1079,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACOSX_DEPLOYMENT_TARGET = 10.15;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -DXcode";
Expand Down Expand Up @@ -1117,6 +1121,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -1129,7 +1134,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACOSX_DEPLOYMENT_TARGET = 10.15;
OTHER_SWIFT_FLAGS = "$(inherited) -DXcode";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1146,17 +1151,18 @@
OBJ_66 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = Z9GT6JU7N2;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
);
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Mantis.xcodeproj/Mantis_Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
Expand Down Expand Up @@ -1184,17 +1190,18 @@
OBJ_67 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = Z9GT6JU7N2;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
);
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Mantis.xcodeproj/Mantis_Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Mantis.xcodeproj/xcshareddata/xcschemes/Mantis.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -31,7 +31,7 @@
</p>

## Requirements
* iOS 11.0+
* iOS 12.0+
* MacOS 10.15+
* Xcode 10.0+

Expand Down
13 changes: 2 additions & 11 deletions Sources/Mantis/CropData.swift
Expand Up @@ -32,16 +32,7 @@ struct CropState: Equatable {
var flipOddTimes: Bool
var transformation: Transformation

init(rotationType: ImageRotationType, degrees: CGFloat, aspectRatioLockEnabled: Bool, aspectRato: CGFloat, flipOddTimes: Bool, transformation: Transformation) {
self.rotationType = rotationType
self.degrees = degrees
self.aspectRatioLockEnabled = aspectRatioLockEnabled
self.aspectRato = aspectRato
self.flipOddTimes = flipOddTimes
self.transformation = transformation
}

static func ==(lhs: CropState, rhs: CropState) -> Bool {
static func == (lhs: CropState, rhs: CropState) -> Bool {
return lhs.rotationType == rhs.rotationType
&& lhs.degrees == rhs.degrees
&& lhs.aspectRatioLockEnabled == rhs.aspectRatioLockEnabled
Expand Down Expand Up @@ -74,7 +65,7 @@ public struct Transformation: Equatable {
self.verticallyFlipped = verticallyFlipped
}

public static func ==(lhs: Transformation, rhs: Transformation) -> Bool {
public static func == (lhs: Transformation, rhs: Transformation) -> Bool {
return lhs.offset == rhs.offset
&& lhs.rotation == rhs.rotation
&& lhs.scale == rhs.scale
Expand Down

0 comments on commit 1c25b09

Please sign in to comment.