Skip to content

Commit

Permalink
Release 2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
artemkrachulov committed Feb 15, 2017
1 parent ebfbe6f commit 3436f26
Show file tree
Hide file tree
Showing 53 changed files with 1,578 additions and 463 deletions.
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Xcode
#
*.DS_Store
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -11,12 +11,12 @@
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.ipa
*.xcuserstate

Pods/
Vendor/
Extra/
#CocoaPods
Pods
Podfile.lock
25 changes: 25 additions & 0 deletions AKImageCropperView.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Pod::Spec.new do |s|

s.name = "AKImageCropperView"
s.version = "2.0.0"
s.homepage = "https://github.com/artemkrachulov/AKImageCropperView"
s.summary = "Responsive image cropper"
s.description = <<-DESC
Image cropping plugin which supported different devices orientation. Easy to set up and configure. Has many settings for flexible integration into your project. Behavior is similar to native iOS photo cropper.
DESC

s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Artem Krachulov" => "[email protected]" }

# Source Info

s.ios.deployment_target = "8.0"

s.source = {
:git => "https://github.com/artemkrachulov/AKImageCropperView.git",
:tag => 'v'+s.version.to_s
}

s.source_files = "AKImageCropperView/*.{swift}"
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
end
13 changes: 4 additions & 9 deletions AKImageCropperView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
011028AB1DFFDD24002AA94E /* AKImageCropperView.h in Headers */ = {isa = PBXBuildFile; fileRef = 011028A91DFFDD24002AA94E /* AKImageCropperView.h */; settings = {ATTRIBUTES = (Public, ); }; };
0141AF1D1E052BF6007C5672 /* AKImageCropperScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0141AF1C1E052BF6007C5672 /* AKImageCropperScrollView.swift */; };
014D3CDB1E30A5B400A9247D /* AKImageCropperTouchDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 014D3CDA1E30A5B400A9247D /* AKImageCropperTouchDelegate.swift */; };
0155304A1E28F2C500961922 /* IC_UIImageExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015530491E28F2C500961922 /* IC_UIImageExtensions.swift */; };
0155304C1E28FDB800961922 /* IC_CGSizeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0155304B1E28FDB800961922 /* IC_CGSizeExtensions.swift */; };
0155304E1E28FEC600961922 /* IC_CGPointExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0155304D1E28FEC600961922 /* IC_CGPointExtension.swift */; };
Expand Down Expand Up @@ -65,8 +64,6 @@
011028A91DFFDD24002AA94E /* AKImageCropperView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AKImageCropperView.h; sourceTree = "<group>"; };
011028AA1DFFDD24002AA94E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0141AF1C1E052BF6007C5672 /* AKImageCropperScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AKImageCropperScrollView.swift; sourceTree = "<group>"; };
014D3CDA1E30A5B400A9247D /* AKImageCropperTouchDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AKImageCropperTouchDelegate.swift; sourceTree = "<group>"; };
015530451E28B8C600961922 /* MyPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MyPlayground.playground; sourceTree = "<group>"; };
015530491E28F2C500961922 /* IC_UIImageExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IC_UIImageExtensions.swift; sourceTree = "<group>"; };
0155304B1E28FDB800961922 /* IC_CGSizeExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IC_CGSizeExtensions.swift; sourceTree = "<group>"; };
0155304D1E28FEC600961922 /* IC_CGPointExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IC_CGPointExtension.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -121,7 +118,6 @@
0141AF1C1E052BF6007C5672 /* AKImageCropperScrollView.swift */,
016E5EED1DFFDD8300662D31 /* AKImageCropperOverlayView.swift */,
016E5EE71DFFDD8300662D31 /* AKImageCropperOverlayViewTouchState.swift */,
014D3CDA1E30A5B400A9247D /* AKImageCropperTouchDelegate.swift */,
01F61BE61E4DC89300977E33 /* configuration */,
015530461E28EF5A00961922 /* extensions */,
);
Expand Down Expand Up @@ -154,7 +150,6 @@
43CBB3F41B870EBC00C8F9AE = {
isa = PBXGroup;
children = (
015530451E28B8C600961922 /* MyPlayground.playground */,
011028A81DFFDD24002AA94E /* AKImageCropperView */,
43CBB3FF1B870EBC00C8F9AE /* AKImageCropperViewExample */,
43CBB3FE1B870EBC00C8F9AE /* Products */,
Expand Down Expand Up @@ -182,8 +177,8 @@
43CBB4041B870EBC00C8F9AE /* HomeViewController.swift */,
43CBB43F1B8739B100C8F9AE /* ImagesTableViewController.swift */,
43CBB4231B8716EA00C8F9AE /* CropperViewController.swift */,
01C48FBB1DEC250100FBBE34 /* CustomImageCropperOverlayView.swift */,
4356D6131B8F3DE90033FDBD /* ImageViewController.swift */,
01C48FBB1DEC250100FBBE34 /* CustomImageCropperOverlayView.swift */,
);
path = AKImageCropperViewExample;
sourceTree = "<group>";
Expand Down Expand Up @@ -257,6 +252,7 @@
};
43CBB3FC1B870EBC00C8F9AE = {
CreatedOnToolsVersion = 6.4;
DevelopmentTeam = 5JV4U8LEZ8;
LastSwiftMigration = 0810;
};
};
Expand Down Expand Up @@ -310,7 +306,6 @@
0155304C1E28FDB800961922 /* IC_CGSizeExtensions.swift in Sources */,
016E5EF81DFFDD8300662D31 /* AKImageCropperOverlayView.swift in Sources */,
0155304A1E28F2C500961922 /* IC_UIImageExtensions.swift in Sources */,
014D3CDB1E30A5B400A9247D /* AKImageCropperTouchDelegate.swift in Sources */,
016E5EFB1DFFDD8300662D31 /* AKImageCropperView.swift in Sources */,
016E5EF31DFFDD8300662D31 /* AKImageCropperOverlayViewConfigurationCorner.swift in Sources */,
01F61BE51E4DC7B800977E33 /* IC_CGFloatExtension.swift in Sources */,
Expand Down Expand Up @@ -521,7 +516,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5JV4U8LEZ8;
INFOPLIST_FILE = AKImageCropperViewExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -537,7 +532,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5JV4U8LEZ8;
INFOPLIST_FILE = AKImageCropperViewExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "011028A61DFFDD24002AA94E"
BuildableName = "AKImageCropperView.framework"
BlueprintName = "AKImageCropperView"
ReferencedContainer = "container:AKImageCropperView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "011028A61DFFDD24002AA94E"
BuildableName = "AKImageCropperView.framework"
BlueprintName = "AKImageCropperView"
ReferencedContainer = "container:AKImageCropperView.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "011028A61DFFDD24002AA94E"
BuildableName = "AKImageCropperView.framework"
BlueprintName = "AKImageCropperView"
ReferencedContainer = "container:AKImageCropperView.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
30 changes: 3 additions & 27 deletions AKImageCropperView/AKImageCropperOverlayView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AKImageCropperCropView.swift
// AKImageCropperOverlayView.swift
//
// Created by Artem Krachulov.
// Copyright (c) 2016 Artem Krachulov. All rights reserved.
Expand Down Expand Up @@ -27,17 +27,6 @@ protocol AKImageCropperOverlayViewDelegate : class {
func cropperOverlayViewDidChangeCropRect(_ view: AKImageCropperOverlayView, _ cropRect: CGRect)
}


// MARK: - AKImageCropperCropView

/**

Overlay view represented as AKImageCropperCropView open class.

Base configuration and behavior can be set or changed with **AKImageCropperOverlayConfiguration** structure. For deep visual changes create the children class and make the necessary configuration in the overrided methods.

*/

open class AKImageCropperOverlayView: UIView {

// MARK: -
Expand Down Expand Up @@ -86,7 +75,6 @@ open class AKImageCropperOverlayView: UIView {
// MARK: Managing the Delegate

weak var delegate: AKImageCropperOverlayViewDelegate?
weak var touchDelegate: AKImageCropperTouchDelegate?

// MARK: Touch & Parts views

Expand Down Expand Up @@ -125,22 +113,20 @@ open class AKImageCropperOverlayView: UIView {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.clipsToBounds = true
// view.isHidden = true
return view
}()

fileprivate lazy var containerImageView: UIView! = {
let view = UIView()
view.backgroundColor = UIColor.brown
view.backgroundColor = UIColor.clear
view.clipsToBounds = true
view.isUserInteractionEnabled = false
// view.isHidden = true
return view
}()

fileprivate lazy var imageView: UIImageView! = {
let view = UIImageView()
view.alpha = 0.5
view.backgroundColor = UIColor.clear
return view
}()

Expand Down Expand Up @@ -856,10 +842,6 @@ open class AKImageCropperOverlayView: UIView {
/* Active part */

activeCropAreaPart = getCropAreaPartContainsPoint(touchesBegan.touch)

/* Delegate */

touchDelegate?.viewDidTouch(self, touches, with: event)
}

override open func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
Expand Down Expand Up @@ -958,19 +940,13 @@ open class AKImageCropperOverlayView: UIView {
/* Delegates */

delegate?.cropperOverlayViewDidChangeCropRect(self, cropRect)
touchDelegate?.viewDidMoveTouch(self, touches, with: event)
}

override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {

/* Active part */

activeCropAreaPart = .none

/* Delegates */

touchDelegate?.viewDidEndTouch(self, touches, with: event)
print("touchesEnded overlay")
}

// MARK: - Instance Method
Expand Down
13 changes: 5 additions & 8 deletions AKImageCropperView/AKImageCropperOverlayViewConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,31 @@ public struct AKImageCropperCropViewConfiguration {
// MARK: Crop rectangle

/// Delay before the crop rectangle will scale to fit cropper view frame edges.
public var zoomingToFitDelay: TimeInterval = 2.0
public var zoomingToFitDelay: TimeInterval = 1.0

/**

Animation options for layout transitions.

- duration: The duration of the transition animation, measured in seconds.
- options: Specifies the supported animation curves.

*/
public var animation: (duration: TimeInterval, options: UIViewAnimationOptions) = (duration: 0.3, options: .curveEaseInOut)

/// Edges insets for crop rectangle. Static values on rotation.
public var cropRectInsets = UIEdgeInsetsMake(50, 50, 50, 50)
/// Edges insets for crop rectangle. Static values for programmatically rotation.

public var cropRectInsets = UIEdgeInsetsMake(20, 20, 20, 20)

/// The smallest value for the crop rectangle sizes. Initial value of this property is 30 pixels width and 30 pixels height.
/// The smallest value for the crop rectangle sizes. Initial value of this property is 60 pixels width and 60 pixels height.
public var minCropRectSize: CGSize = CGSize(width: 60, height: 60)

/// Touch view where will be drawn the corner.
public var cornerTouchSize: CGSize = CGSize(width: 30.0, height: 30.0)

/**

Thickness for edges touch area. This touch view is centered on the edge line.

- vertical: Thickness for vertical edges: Left, Right.
- horizontal: Thickness for horizontal edges: Top, Bottom.

*/
public var edgeTouchThickness: (vertical: CGFloat, horizontal: CGFloat) = (vertical: 20.0, horizontal: 20.0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public struct AKImageCropperCropViewConfigurationCorner {
public var highlightedSize: CGSize = CGSize(width: 30, height: 30)

/// Line color for normal corner state.
public var normalLineColor: UIColor = UIColor.white
public var normalLineColor: UIColor = .white

/// Line color for highlighted corner state.
public var highlightedLineColor: UIColor = UIColor.white
public var highlightedLineColor: UIColor = .white
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public struct AKImageCropperCropViewConfigurationEdge {
public var highlightedLineWidth: CGFloat = 3.0

/// Line color for normal edge state.
public var normalLineColor: UIColor = UIColor.white
public var normalLineColor: UIColor = .white

/// Line color for highlighted edge state.
public var highlightedLineColor: UIColor = UIColor.white
public var highlightedLineColor: UIColor = .white
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ public struct AKImageCropperCropViewConfigurationGrid {
public var alwaysShowGrid: Bool = false

/**

The number of vertical and horizontal lines inside the crop rectangle.

- vertical: Vertical lines count.
- horizontal: Horizontal lines count.

*/
*/
public var linesCount: (vertical: Int, horizontal: Int) = (vertical: 2, horizontal: 2)

/// Vertical and horizontal lines width.
Expand Down
Loading

0 comments on commit 3436f26

Please sign in to comment.