├── .gitignore ├── .swift-version ├── .travis.yml ├── Example ├── PKCCrop.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── PKCCrop-Example.xcscheme ├── PKCCrop.xcworkspace │ └── contents.xcworkspacedata ├── PKCCrop │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── ViewController.swift │ ├── image.jpeg │ ├── pkc_crop_rotate_left.png │ └── pkc_crop_rotate_right.png ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── PKCCrop.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── PKCCrop │ │ ├── Info.plist │ │ ├── PKCCrop-dummy.m │ │ ├── PKCCrop-prefix.pch │ │ ├── PKCCrop-umbrella.h │ │ ├── PKCCrop.modulemap │ │ └── PKCCrop.xcconfig │ │ ├── Pods-PKCCrop_Example │ │ ├── Info.plist │ │ ├── Pods-PKCCrop_Example-acknowledgements.markdown │ │ ├── Pods-PKCCrop_Example-acknowledgements.plist │ │ ├── Pods-PKCCrop_Example-dummy.m │ │ ├── Pods-PKCCrop_Example-frameworks.sh │ │ ├── Pods-PKCCrop_Example-resources.sh │ │ ├── Pods-PKCCrop_Example-umbrella.h │ │ ├── Pods-PKCCrop_Example.debug.xcconfig │ │ ├── Pods-PKCCrop_Example.modulemap │ │ └── Pods-PKCCrop_Example.release.xcconfig │ │ └── Pods-PKCCrop_Tests │ │ ├── Info.plist │ │ ├── Pods-PKCCrop_Tests-acknowledgements.markdown │ │ ├── Pods-PKCCrop_Tests-acknowledgements.plist │ │ ├── Pods-PKCCrop_Tests-dummy.m │ │ ├── Pods-PKCCrop_Tests-frameworks.sh │ │ ├── Pods-PKCCrop_Tests-resources.sh │ │ ├── Pods-PKCCrop_Tests-umbrella.h │ │ ├── Pods-PKCCrop_Tests.debug.xcconfig │ │ ├── Pods-PKCCrop_Tests.modulemap │ │ └── Pods-PKCCrop_Tests.release.xcconfig └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── PKCCrop.podspec ├── PKCCrop ├── Assets │ ├── .gitkeep │ ├── pkc_crop_bottom_left.png │ ├── pkc_crop_bottom_right.png │ ├── pkc_crop_rotate_left.png │ ├── pkc_crop_rotate_right.png │ ├── pkc_crop_top_left.png │ └── pkc_crop_top_right.png └── Classes │ ├── .gitkeep │ ├── PKCButton.swift │ ├── PKCCrop.swift │ ├── PKCCropHelper.swift │ ├── PKCCropLineView.swift │ ├── PKCCropLineView.xib │ ├── PKCCropViewController.swift │ ├── PKCCropViewController.xib │ ├── UIImageView+.swift │ └── UIView+.swift ├── README.md ├── _Pods.xcodeproj ├── image1.png ├── image2.png ├── image3.png ├── img.gif ├── pkc_crop_rotate_left.png └── pkc_crop_rotate_right.png /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/PKCCrop.xcworkspace -scheme PKCCrop-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/PKCCrop.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0C9BAADC1F518EB3001AA9AA /* image.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 0C9BAADB1F518EB3001AA9AA /* image.jpeg */; }; 11 | 0C9BAAFE1F51B253001AA9AA /* pkc_crop_rotate_left.png in Resources */ = {isa = PBXBuildFile; fileRef = 0C9BAAFC1F51B253001AA9AA /* pkc_crop_rotate_left.png */; }; 12 | 0C9BAAFF1F51B253001AA9AA /* pkc_crop_rotate_right.png in Resources */ = {isa = PBXBuildFile; fileRef = 0C9BAAFD1F51B253001AA9AA /* pkc_crop_rotate_right.png */; }; 13 | 2267FE0C8CA06EB5F4D6DD89 /* Pods_PKCCrop_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCE0F253F3F08D0486B6E23C /* Pods_PKCCrop_Example.framework */; }; 14 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 15 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 16 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 17 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 18 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 19 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 20 | D01F979528DB830EEE36B3B9 /* Pods_PKCCrop_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0625E1157C5624CA25C2B820 /* Pods_PKCCrop_Tests.framework */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 29 | remoteInfo = PKCCrop; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 0625E1157C5624CA25C2B820 /* Pods_PKCCrop_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PKCCrop_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 0C9BAADB1F518EB3001AA9AA /* image.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image.jpeg; sourceTree = ""; }; 36 | 0C9BAAFC1F51B253001AA9AA /* pkc_crop_rotate_left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pkc_crop_rotate_left.png; sourceTree = ""; }; 37 | 0C9BAAFD1F51B253001AA9AA /* pkc_crop_rotate_right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pkc_crop_rotate_right.png; sourceTree = ""; }; 38 | 0EFDAA7E952D8270E2528C01 /* Pods-PKCCrop_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PKCCrop_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.debug.xcconfig"; sourceTree = ""; }; 39 | 607FACD01AFB9204008FA782 /* PKCCrop_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PKCCrop_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 42 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 43 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 45 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 46 | 607FACE51AFB9204008FA782 /* PKCCrop_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PKCCrop_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 49 | 82B87A7C91C78C7A37218CF1 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 50 | 910753236C66FE4B444C552E /* PKCCrop.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PKCCrop.podspec; path = ../PKCCrop.podspec; sourceTree = ""; }; 51 | 919740DAE5AAA949502BA009 /* Pods-PKCCrop_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PKCCrop_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.debug.xcconfig"; sourceTree = ""; }; 52 | EECE54903AD2BAE126F983F3 /* Pods-PKCCrop_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PKCCrop_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.release.xcconfig"; sourceTree = ""; }; 53 | F61F0B538C2FF1A4110C04B7 /* Pods-PKCCrop_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PKCCrop_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.release.xcconfig"; sourceTree = ""; }; 54 | FCE0F253F3F08D0486B6E23C /* Pods_PKCCrop_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PKCCrop_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | FDEC84B51D289A8CC5D23261 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 2267FE0C8CA06EB5F4D6DD89 /* Pods_PKCCrop_Example.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | D01F979528DB830EEE36B3B9 /* Pods_PKCCrop_Tests.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 607FACC71AFB9204008FA782 = { 79 | isa = PBXGroup; 80 | children = ( 81 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 82 | 607FACD21AFB9204008FA782 /* Example for PKCCrop */, 83 | 607FACE81AFB9204008FA782 /* Tests */, 84 | 607FACD11AFB9204008FA782 /* Products */, 85 | F8194EA43D620547918CDA9C /* Pods */, 86 | 8E336FBA19253453E8151CB6 /* Frameworks */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 607FACD11AFB9204008FA782 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 607FACD01AFB9204008FA782 /* PKCCrop_Example.app */, 94 | 607FACE51AFB9204008FA782 /* PKCCrop_Tests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 607FACD21AFB9204008FA782 /* Example for PKCCrop */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 0C9BAAFC1F51B253001AA9AA /* pkc_crop_rotate_left.png */, 103 | 0C9BAAFD1F51B253001AA9AA /* pkc_crop_rotate_right.png */, 104 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 105 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 106 | 0C9BAADB1F518EB3001AA9AA /* image.jpeg */, 107 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 108 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 109 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 110 | 607FACD31AFB9204008FA782 /* Supporting Files */, 111 | ); 112 | name = "Example for PKCCrop"; 113 | path = PKCCrop; 114 | sourceTree = ""; 115 | }; 116 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 607FACD41AFB9204008FA782 /* Info.plist */, 120 | ); 121 | name = "Supporting Files"; 122 | sourceTree = ""; 123 | }; 124 | 607FACE81AFB9204008FA782 /* Tests */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 128 | 607FACE91AFB9204008FA782 /* Supporting Files */, 129 | ); 130 | path = Tests; 131 | sourceTree = ""; 132 | }; 133 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 607FACEA1AFB9204008FA782 /* Info.plist */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 910753236C66FE4B444C552E /* PKCCrop.podspec */, 145 | FDEC84B51D289A8CC5D23261 /* README.md */, 146 | 82B87A7C91C78C7A37218CF1 /* LICENSE */, 147 | ); 148 | name = "Podspec Metadata"; 149 | sourceTree = ""; 150 | }; 151 | 8E336FBA19253453E8151CB6 /* Frameworks */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | FCE0F253F3F08D0486B6E23C /* Pods_PKCCrop_Example.framework */, 155 | 0625E1157C5624CA25C2B820 /* Pods_PKCCrop_Tests.framework */, 156 | ); 157 | name = Frameworks; 158 | sourceTree = ""; 159 | }; 160 | F8194EA43D620547918CDA9C /* Pods */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 919740DAE5AAA949502BA009 /* Pods-PKCCrop_Example.debug.xcconfig */, 164 | F61F0B538C2FF1A4110C04B7 /* Pods-PKCCrop_Example.release.xcconfig */, 165 | 0EFDAA7E952D8270E2528C01 /* Pods-PKCCrop_Tests.debug.xcconfig */, 166 | EECE54903AD2BAE126F983F3 /* Pods-PKCCrop_Tests.release.xcconfig */, 167 | ); 168 | name = Pods; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 607FACCF1AFB9204008FA782 /* PKCCrop_Example */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PKCCrop_Example" */; 177 | buildPhases = ( 178 | B0757745B7A4736904E31837 /* [CP] Check Pods Manifest.lock */, 179 | 607FACCC1AFB9204008FA782 /* Sources */, 180 | 607FACCD1AFB9204008FA782 /* Frameworks */, 181 | 607FACCE1AFB9204008FA782 /* Resources */, 182 | 63E6BFDB88D51406991D0D85 /* [CP] Embed Pods Frameworks */, 183 | 11AF935EDD9CA5E30B07A8EF /* [CP] Copy Pods Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | ); 189 | name = PKCCrop_Example; 190 | productName = PKCCrop; 191 | productReference = 607FACD01AFB9204008FA782 /* PKCCrop_Example.app */; 192 | productType = "com.apple.product-type.application"; 193 | }; 194 | 607FACE41AFB9204008FA782 /* PKCCrop_Tests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PKCCrop_Tests" */; 197 | buildPhases = ( 198 | 9AC6EC50B8AFEDEADE4D69A8 /* [CP] Check Pods Manifest.lock */, 199 | 607FACE11AFB9204008FA782 /* Sources */, 200 | 607FACE21AFB9204008FA782 /* Frameworks */, 201 | 607FACE31AFB9204008FA782 /* Resources */, 202 | 50E0EDB19428501E960AD810 /* [CP] Embed Pods Frameworks */, 203 | C421D855CFF7813F73548271 /* [CP] Copy Pods Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 209 | ); 210 | name = PKCCrop_Tests; 211 | productName = Tests; 212 | productReference = 607FACE51AFB9204008FA782 /* PKCCrop_Tests.xctest */; 213 | productType = "com.apple.product-type.bundle.unit-test"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | 607FACC81AFB9204008FA782 /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | LastSwiftUpdateCheck = 0720; 222 | LastUpgradeCheck = 0820; 223 | ORGANIZATIONNAME = CocoaPods; 224 | TargetAttributes = { 225 | 607FACCF1AFB9204008FA782 = { 226 | CreatedOnToolsVersion = 6.3.1; 227 | LastSwiftMigration = 0820; 228 | }; 229 | 607FACE41AFB9204008FA782 = { 230 | CreatedOnToolsVersion = 6.3.1; 231 | LastSwiftMigration = 0820; 232 | TestTargetID = 607FACCF1AFB9204008FA782; 233 | }; 234 | }; 235 | }; 236 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "PKCCrop" */; 237 | compatibilityVersion = "Xcode 3.2"; 238 | developmentRegion = English; 239 | hasScannedForEncodings = 0; 240 | knownRegions = ( 241 | en, 242 | Base, 243 | ); 244 | mainGroup = 607FACC71AFB9204008FA782; 245 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 246 | projectDirPath = ""; 247 | projectRoot = ""; 248 | targets = ( 249 | 607FACCF1AFB9204008FA782 /* PKCCrop_Example */, 250 | 607FACE41AFB9204008FA782 /* PKCCrop_Tests */, 251 | ); 252 | }; 253 | /* End PBXProject section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | 607FACCE1AFB9204008FA782 /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 261 | 0C9BAADC1F518EB3001AA9AA /* image.jpeg in Resources */, 262 | 0C9BAAFE1F51B253001AA9AA /* pkc_crop_rotate_left.png in Resources */, 263 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 264 | 0C9BAAFF1F51B253001AA9AA /* pkc_crop_rotate_right.png in Resources */, 265 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | 607FACE31AFB9204008FA782 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXResourcesBuildPhase section */ 277 | 278 | /* Begin PBXShellScriptBuildPhase section */ 279 | 11AF935EDD9CA5E30B07A8EF /* [CP] Copy Pods Resources */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputPaths = ( 285 | ); 286 | name = "[CP] Copy Pods Resources"; 287 | outputPaths = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | shellPath = /bin/sh; 291 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-resources.sh\"\n"; 292 | showEnvVarsInLog = 0; 293 | }; 294 | 50E0EDB19428501E960AD810 /* [CP] Embed Pods Frameworks */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | ); 299 | inputPaths = ( 300 | ); 301 | name = "[CP] Embed Pods Frameworks"; 302 | outputPaths = ( 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-frameworks.sh\"\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | 63E6BFDB88D51406991D0D85 /* [CP] Embed Pods Frameworks */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputPaths = ( 315 | ); 316 | name = "[CP] Embed Pods Frameworks"; 317 | outputPaths = ( 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | shellPath = /bin/sh; 321 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-frameworks.sh\"\n"; 322 | showEnvVarsInLog = 0; 323 | }; 324 | 9AC6EC50B8AFEDEADE4D69A8 /* [CP] Check Pods Manifest.lock */ = { 325 | isa = PBXShellScriptBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | ); 329 | inputPaths = ( 330 | ); 331 | name = "[CP] Check Pods Manifest.lock"; 332 | outputPaths = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | shellPath = /bin/sh; 336 | 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"; 337 | showEnvVarsInLog = 0; 338 | }; 339 | B0757745B7A4736904E31837 /* [CP] Check Pods Manifest.lock */ = { 340 | isa = PBXShellScriptBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | inputPaths = ( 345 | ); 346 | name = "[CP] Check Pods Manifest.lock"; 347 | outputPaths = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | 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"; 352 | showEnvVarsInLog = 0; 353 | }; 354 | C421D855CFF7813F73548271 /* [CP] Copy Pods Resources */ = { 355 | isa = PBXShellScriptBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | inputPaths = ( 360 | ); 361 | name = "[CP] Copy Pods Resources"; 362 | outputPaths = ( 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | shellPath = /bin/sh; 366 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-resources.sh\"\n"; 367 | showEnvVarsInLog = 0; 368 | }; 369 | /* End PBXShellScriptBuildPhase section */ 370 | 371 | /* Begin PBXSourcesBuildPhase section */ 372 | 607FACCC1AFB9204008FA782 /* Sources */ = { 373 | isa = PBXSourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 377 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 378 | ); 379 | runOnlyForDeploymentPostprocessing = 0; 380 | }; 381 | 607FACE11AFB9204008FA782 /* Sources */ = { 382 | isa = PBXSourcesBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | }; 389 | /* End PBXSourcesBuildPhase section */ 390 | 391 | /* Begin PBXTargetDependency section */ 392 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 393 | isa = PBXTargetDependency; 394 | target = 607FACCF1AFB9204008FA782 /* PKCCrop_Example */; 395 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 396 | }; 397 | /* End PBXTargetDependency section */ 398 | 399 | /* Begin PBXVariantGroup section */ 400 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 401 | isa = PBXVariantGroup; 402 | children = ( 403 | 607FACDA1AFB9204008FA782 /* Base */, 404 | ); 405 | name = Main.storyboard; 406 | sourceTree = ""; 407 | }; 408 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 409 | isa = PBXVariantGroup; 410 | children = ( 411 | 607FACDF1AFB9204008FA782 /* Base */, 412 | ); 413 | name = LaunchScreen.xib; 414 | sourceTree = ""; 415 | }; 416 | /* End PBXVariantGroup section */ 417 | 418 | /* Begin XCBuildConfiguration section */ 419 | 607FACED1AFB9204008FA782 /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ALWAYS_SEARCH_USER_PATHS = NO; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_CXX_LIBRARY = "libc++"; 425 | CLANG_ENABLE_MODULES = YES; 426 | CLANG_ENABLE_OBJC_ARC = YES; 427 | CLANG_WARN_BOOL_CONVERSION = YES; 428 | CLANG_WARN_CONSTANT_CONVERSION = YES; 429 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 430 | CLANG_WARN_EMPTY_BODY = YES; 431 | CLANG_WARN_ENUM_CONVERSION = YES; 432 | CLANG_WARN_INFINITE_RECURSION = YES; 433 | CLANG_WARN_INT_CONVERSION = YES; 434 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 435 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 436 | CLANG_WARN_UNREACHABLE_CODE = YES; 437 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 438 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 439 | COPY_PHASE_STRIP = NO; 440 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 441 | ENABLE_STRICT_OBJC_MSGSEND = YES; 442 | ENABLE_TESTABILITY = YES; 443 | GCC_C_LANGUAGE_STANDARD = gnu99; 444 | GCC_DYNAMIC_NO_PIC = NO; 445 | GCC_NO_COMMON_BLOCKS = YES; 446 | GCC_OPTIMIZATION_LEVEL = 0; 447 | GCC_PREPROCESSOR_DEFINITIONS = ( 448 | "DEBUG=1", 449 | "$(inherited)", 450 | ); 451 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 452 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 453 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 454 | GCC_WARN_UNDECLARED_SELECTOR = YES; 455 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 456 | GCC_WARN_UNUSED_FUNCTION = YES; 457 | GCC_WARN_UNUSED_VARIABLE = YES; 458 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 459 | MTL_ENABLE_DEBUG_INFO = YES; 460 | ONLY_ACTIVE_ARCH = YES; 461 | SDKROOT = iphoneos; 462 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 463 | }; 464 | name = Debug; 465 | }; 466 | 607FACEE1AFB9204008FA782 /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | ALWAYS_SEARCH_USER_PATHS = NO; 470 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 471 | CLANG_CXX_LIBRARY = "libc++"; 472 | CLANG_ENABLE_MODULES = YES; 473 | CLANG_ENABLE_OBJC_ARC = YES; 474 | CLANG_WARN_BOOL_CONVERSION = YES; 475 | CLANG_WARN_CONSTANT_CONVERSION = YES; 476 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 477 | CLANG_WARN_EMPTY_BODY = YES; 478 | CLANG_WARN_ENUM_CONVERSION = YES; 479 | CLANG_WARN_INFINITE_RECURSION = YES; 480 | CLANG_WARN_INT_CONVERSION = YES; 481 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 482 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 483 | CLANG_WARN_UNREACHABLE_CODE = YES; 484 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 485 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 486 | COPY_PHASE_STRIP = NO; 487 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 488 | ENABLE_NS_ASSERTIONS = NO; 489 | ENABLE_STRICT_OBJC_MSGSEND = YES; 490 | GCC_C_LANGUAGE_STANDARD = gnu99; 491 | GCC_NO_COMMON_BLOCKS = YES; 492 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 493 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 494 | GCC_WARN_UNDECLARED_SELECTOR = YES; 495 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 496 | GCC_WARN_UNUSED_FUNCTION = YES; 497 | GCC_WARN_UNUSED_VARIABLE = YES; 498 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 499 | MTL_ENABLE_DEBUG_INFO = NO; 500 | SDKROOT = iphoneos; 501 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 502 | VALIDATE_PRODUCT = YES; 503 | }; 504 | name = Release; 505 | }; 506 | 607FACF01AFB9204008FA782 /* Debug */ = { 507 | isa = XCBuildConfiguration; 508 | baseConfigurationReference = 919740DAE5AAA949502BA009 /* Pods-PKCCrop_Example.debug.xcconfig */; 509 | buildSettings = { 510 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 511 | INFOPLIST_FILE = PKCCrop/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 513 | MODULE_NAME = ExampleApp; 514 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_VERSION = 3.0; 517 | }; 518 | name = Debug; 519 | }; 520 | 607FACF11AFB9204008FA782 /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | baseConfigurationReference = F61F0B538C2FF1A4110C04B7 /* Pods-PKCCrop_Example.release.xcconfig */; 523 | buildSettings = { 524 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 525 | INFOPLIST_FILE = PKCCrop/Info.plist; 526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 527 | MODULE_NAME = ExampleApp; 528 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | SWIFT_VERSION = 3.0; 531 | }; 532 | name = Release; 533 | }; 534 | 607FACF31AFB9204008FA782 /* Debug */ = { 535 | isa = XCBuildConfiguration; 536 | baseConfigurationReference = 0EFDAA7E952D8270E2528C01 /* Pods-PKCCrop_Tests.debug.xcconfig */; 537 | buildSettings = { 538 | FRAMEWORK_SEARCH_PATHS = ( 539 | "$(SDKROOT)/Developer/Library/Frameworks", 540 | "$(inherited)", 541 | ); 542 | GCC_PREPROCESSOR_DEFINITIONS = ( 543 | "DEBUG=1", 544 | "$(inherited)", 545 | ); 546 | INFOPLIST_FILE = Tests/Info.plist; 547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 548 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 549 | PRODUCT_NAME = "$(TARGET_NAME)"; 550 | SWIFT_VERSION = 3.0; 551 | }; 552 | name = Debug; 553 | }; 554 | 607FACF41AFB9204008FA782 /* Release */ = { 555 | isa = XCBuildConfiguration; 556 | baseConfigurationReference = EECE54903AD2BAE126F983F3 /* Pods-PKCCrop_Tests.release.xcconfig */; 557 | buildSettings = { 558 | FRAMEWORK_SEARCH_PATHS = ( 559 | "$(SDKROOT)/Developer/Library/Frameworks", 560 | "$(inherited)", 561 | ); 562 | INFOPLIST_FILE = Tests/Info.plist; 563 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 564 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 565 | PRODUCT_NAME = "$(TARGET_NAME)"; 566 | SWIFT_VERSION = 3.0; 567 | }; 568 | name = Release; 569 | }; 570 | /* End XCBuildConfiguration section */ 571 | 572 | /* Begin XCConfigurationList section */ 573 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "PKCCrop" */ = { 574 | isa = XCConfigurationList; 575 | buildConfigurations = ( 576 | 607FACED1AFB9204008FA782 /* Debug */, 577 | 607FACEE1AFB9204008FA782 /* Release */, 578 | ); 579 | defaultConfigurationIsVisible = 0; 580 | defaultConfigurationName = Release; 581 | }; 582 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PKCCrop_Example" */ = { 583 | isa = XCConfigurationList; 584 | buildConfigurations = ( 585 | 607FACF01AFB9204008FA782 /* Debug */, 586 | 607FACF11AFB9204008FA782 /* Release */, 587 | ); 588 | defaultConfigurationIsVisible = 0; 589 | defaultConfigurationName = Release; 590 | }; 591 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "PKCCrop_Tests" */ = { 592 | isa = XCConfigurationList; 593 | buildConfigurations = ( 594 | 607FACF31AFB9204008FA782 /* Debug */, 595 | 607FACF41AFB9204008FA782 /* Release */, 596 | ); 597 | defaultConfigurationIsVisible = 0; 598 | defaultConfigurationName = Release; 599 | }; 600 | /* End XCConfigurationList section */ 601 | }; 602 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 603 | } 604 | -------------------------------------------------------------------------------- /Example/PKCCrop.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/PKCCrop.xcodeproj/xcshareddata/xcschemes/PKCCrop-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/PKCCrop.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/PKCCrop/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PKCCrop 4 | // 5 | // Created by pikachu987 on 08/26/2017. 6 | // Copyright (c) 2017 pikachu987. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/PKCCrop/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/PKCCrop/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Example/PKCCrop/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/PKCCrop/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/PKCCrop/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PKCCrop 4 | // 5 | // Created by pikachu987 on 08/26/2017. 6 | // Copyright (c) 2017 pikachu987. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import PKCCrop 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet fileprivate weak var imageView: UIImageView! 15 | @IBOutlet fileprivate weak var widthConst: NSLayoutConstraint! 16 | @IBOutlet fileprivate weak var heightConst: NSLayoutConstraint! 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | // Do any additional setup after loading the view, typically from a nib. 21 | 22 | self.title = "PKCCrop" 23 | self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(self.cropAction(_:))) 24 | 25 | PKCCropHelper.shared.degressBeforeImage = UIImage(named: "pkc_crop_rotate_left.png") 26 | PKCCropHelper.shared.degressAfterImage = UIImage(named: "pkc_crop_rotate_right.png") 27 | 28 | DispatchQueue.main.async { 29 | self.cropAction() 30 | } 31 | } 32 | 33 | override func didReceiveMemoryWarning() { 34 | super.didReceiveMemoryWarning() 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | 39 | @objc private func cropAction(_ sender: UIBarButtonItem){ 40 | self.cropAction() 41 | } 42 | 43 | private func cropAction(){ 44 | let alertController = UIAlertController(title: "", message: "choice type", preferredStyle: .actionSheet) 45 | alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) 46 | alertController.addAction(UIAlertAction(title: "Open Gallery", style: .default, handler: { (_) in 47 | if UIImagePickerController.isSourceTypeAvailable(.photoLibrary){ 48 | let imagePickerController = UIImagePickerController() 49 | imagePickerController.delegate = self 50 | imagePickerController.sourceType = .photoLibrary 51 | self.present(imagePickerController, animated: true, completion: nil) 52 | } 53 | })) 54 | alertController.addAction(UIAlertAction(title: "Image 1", style: .default, handler: { (_) in 55 | PKCCropHelper.shared.isNavigationBarShow = false 56 | let cropVC = PKCCropViewController(UIImage(named: "image.jpeg")!) 57 | cropVC.delegate = self 58 | self.navigationController?.pushViewController(cropVC, animated: true) 59 | })) 60 | self.present(alertController, animated: true, completion: nil) 61 | } 62 | } 63 | 64 | 65 | 66 | extension ViewController: PKCCropDelegate{ 67 | //return Crop Image & Original Image 68 | func pkcCropImage(_ image: UIImage?, originalImage: UIImage?) { 69 | if let image = image{ 70 | self.widthConst.constant = image.size.width 71 | self.heightConst.constant = image.size.height 72 | } 73 | self.imageView.image = image 74 | } 75 | 76 | //If crop is canceled 77 | func pkcCropCancel(_ viewController: PKCCropViewController) { 78 | viewController.navigationController?.popViewController(animated: true) 79 | } 80 | 81 | //Successful crop 82 | func pkcCropComplete(_ viewController: PKCCropViewController) { 83 | if viewController.tag == 0{ 84 | viewController.navigationController?.popViewController(animated: true) 85 | }else{ 86 | viewController.dismiss(animated: true, completion: nil) 87 | } 88 | } 89 | } 90 | 91 | 92 | 93 | 94 | 95 | extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate{ 96 | func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { 97 | picker.dismiss(animated: true, completion: nil) 98 | } 99 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 100 | guard let image = info[UIImagePickerControllerOriginalImage] as? UIImage else{ 101 | return 102 | } 103 | PKCCropHelper.shared.isNavigationBarShow = true 104 | let cropVC = PKCCropViewController(image, tag: 1) 105 | cropVC.delegate = self 106 | picker.pushViewController(cropVC, animated: true) 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Example/PKCCrop/image.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/Example/PKCCrop/image.jpeg -------------------------------------------------------------------------------- /Example/PKCCrop/pkc_crop_rotate_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/Example/PKCCrop/pkc_crop_rotate_left.png -------------------------------------------------------------------------------- /Example/PKCCrop/pkc_crop_rotate_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/Example/PKCCrop/pkc_crop_rotate_right.png -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'PKCCrop_Example' do 4 | pod 'PKCCrop', :path => '../' 5 | 6 | target 'PKCCrop_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - PKCCrop (0.2.2) 3 | 4 | DEPENDENCIES: 5 | - PKCCrop (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | PKCCrop: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | PKCCrop: da59f51545546923ccbea5204cc4347fb62f7cec 13 | 14 | PODFILE CHECKSUM: 7fb175e6ce2262a32a03407de01cd2220cca51c0 15 | 16 | COCOAPODS: 1.3.0.beta.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/PKCCrop.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PKCCrop", 3 | "version": "0.2.2", 4 | "summary": "Images crop", 5 | "description": "There are many options that can be used to easily put images into crops.", 6 | "homepage": "https://github.com/pikachu987/PKCCrop", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "pikachu987": "pikachu987@naver.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/pikachu987/PKCCrop.git", 16 | "tag": "0.2.2" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "PKCCrop/Classes/*" 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - PKCCrop (0.2.2) 3 | 4 | DEPENDENCIES: 5 | - PKCCrop (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | PKCCrop: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | PKCCrop: da59f51545546923ccbea5204cc4347fb62f7cec 13 | 14 | PODFILE CHECKSUM: 7fb175e6ce2262a32a03407de01cd2220cca51c0 15 | 16 | COCOAPODS: 1.3.0.beta.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1756B5325FB958169A81148172EB97CA /* PKCCropViewController.xib in Sources */ = {isa = PBXBuildFile; fileRef = ACDAEDF27CDA6B803DE86E0178BCF1E5 /* PKCCropViewController.xib */; }; 11 | 2D999485B038B874732B9AA2A36471FD /* PKCCrop-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 31EF83E47C569397A90AC431C6729421 /* PKCCrop-dummy.m */; }; 12 | 39DF190435D5E85B4016FE8A141054B2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; 13 | 3BC0D4351690C5568254B432F3936302 /* PKCCrop-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 426AD31E838FDC430FCA9188A1693008 /* PKCCrop-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 483E92D5B7F96E93CF310CEE73511426 /* PKCCrop.swift in Sources */ = {isa = PBXBuildFile; fileRef = A24283CB06A31A27E88714C32F4C3A94 /* PKCCrop.swift */; }; 15 | 52186C7927933DC9C267C6DE72852536 /* PKCCropHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C7DF3B9E6B6EFFB35E058D72CAE5DD /* PKCCropHelper.swift */; }; 16 | 76E785678C91DC5BF7DDC9849F94D55B /* Pods-PKCCrop_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F875D9FB7DFB2A0A5163C671E434A6BA /* Pods-PKCCrop_Tests-dummy.m */; }; 17 | 8D9C49578BE3D99E9BE8A87B96ACB283 /* PKCCropLineView.xib in Sources */ = {isa = PBXBuildFile; fileRef = 52CD7E3C0F751888FB5CB6FF36FA6D1F /* PKCCropLineView.xib */; }; 18 | A0BC6547B77FD59B180BD90D1D4F6DFA /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A21E2FE2804B8889198A44987192D91 /* UIView+.swift */; }; 19 | B24BB41ADAEEFBF296F179BF3849E8D5 /* UIImageView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B20B5D94F2A9F4616341FF3D9D97270 /* UIImageView+.swift */; }; 20 | C1108E8AC532ED82EC7E0F110A88890D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; 21 | D2D25C7C699B5E60E01B0F92139F65AF /* Pods-PKCCrop_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A27DB6E4A3CF74B74E3D29E2A3E78C7C /* Pods-PKCCrop_Example-dummy.m */; }; 22 | D4E1099C23FCEB12004784821F7AA1CE /* Pods-PKCCrop_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 778AC436DE144D6F0FBDECF0D8FAF4F1 /* Pods-PKCCrop_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | D607B4688263F391B4547C11D1347E59 /* PKCCropViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE672951FD65B00E6633776F3261DA4E /* PKCCropViewController.swift */; }; 24 | DC2934B775837180D068427376CDECD4 /* PKCCropLineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E498AD7079E05706621B0D75AC9E5475 /* PKCCropLineView.swift */; }; 25 | EFB7BADE058AA97EAFCC6208E7ACE2C6 /* PKCButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43AFDFD8F95C9E453A1657B692836EDA /* PKCButton.swift */; }; 26 | F11B9C7C7CBB9407C5E839C268758F65 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; }; 27 | FB8894BDD14725F2E0AFD6862729C548 /* Pods-PKCCrop_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1B9A20FCA7C803BA5BBBD1FF8B890E /* Pods-PKCCrop_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | C14B39EE3CF426EB1691FCC14D61F663 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 0C38E9F7AB6BC55A24E43957EF45C6A0; 36 | remoteInfo = PKCCrop; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 0A21E2FE2804B8889198A44987192D91 /* UIView+.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = ""; }; 42 | 139C4E729234E56C4878EE45D76519F1 /* Pods-PKCCrop_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PKCCrop_Example-acknowledgements.plist"; sourceTree = ""; }; 43 | 236E212F6F98CFDA4452FE5A94D9A6F0 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 25D911C0A7C19FD81A4569A557D8E6C9 /* Pods-PKCCrop_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-PKCCrop_Example.modulemap"; sourceTree = ""; }; 45 | 2B20B5D94F2A9F4616341FF3D9D97270 /* UIImageView+.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIImageView+.swift"; sourceTree = ""; }; 46 | 31E2CF919670459DC1228CE235BE04D0 /* Pods-PKCCrop_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PKCCrop_Tests-acknowledgements.plist"; sourceTree = ""; }; 47 | 31EF83E47C569397A90AC431C6729421 /* PKCCrop-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PKCCrop-dummy.m"; sourceTree = ""; }; 48 | 42122F7705F8D51FB8E5A00145030342 /* Pods-PKCCrop_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PKCCrop_Example-acknowledgements.markdown"; sourceTree = ""; }; 49 | 426AD31E838FDC430FCA9188A1693008 /* PKCCrop-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PKCCrop-umbrella.h"; sourceTree = ""; }; 50 | 43AFDFD8F95C9E453A1657B692836EDA /* PKCButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PKCButton.swift; sourceTree = ""; }; 51 | 465001315E0C163D757E880BA18E81F6 /* Pods-PKCCrop_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PKCCrop_Example-resources.sh"; sourceTree = ""; }; 52 | 5138FA381DC4AB2A1CBA58E7C626BDD5 /* PKCCrop.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PKCCrop.xcconfig; sourceTree = ""; }; 53 | 52CD7E3C0F751888FB5CB6FF36FA6D1F /* PKCCropLineView.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; path = PKCCropLineView.xib; sourceTree = ""; }; 54 | 53C7DF3B9E6B6EFFB35E058D72CAE5DD /* PKCCropHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PKCCropHelper.swift; sourceTree = ""; }; 55 | 59096F0CF72717DF02C05F84FDD2C8E9 /* Pods_PKCCrop_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PKCCrop_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 57 | 722628FA546E503380664DCEA780957A /* Pods-PKCCrop_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PKCCrop_Example-frameworks.sh"; sourceTree = ""; }; 58 | 778AC436DE144D6F0FBDECF0D8FAF4F1 /* Pods-PKCCrop_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PKCCrop_Example-umbrella.h"; sourceTree = ""; }; 59 | 7C1B9A20FCA7C803BA5BBBD1FF8B890E /* Pods-PKCCrop_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PKCCrop_Tests-umbrella.h"; sourceTree = ""; }; 60 | 7CFF51F9C7491662F737DF9FCED5F747 /* Pods-PKCCrop_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PKCCrop_Tests-frameworks.sh"; sourceTree = ""; }; 61 | 8BFD0BEBDBC92B5622B0AB9EB5CB4B57 /* Pods-PKCCrop_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PKCCrop_Tests.release.xcconfig"; sourceTree = ""; }; 62 | 8DF75849394A6FA6CAF1BC9AA5204562 /* Pods-PKCCrop_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PKCCrop_Tests-acknowledgements.markdown"; sourceTree = ""; }; 63 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 64 | 93EF8BF355DFCAE6448A0FA3265FC379 /* Pods-PKCCrop_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PKCCrop_Example.release.xcconfig"; sourceTree = ""; }; 65 | 9864E58F8B8E492B89B2BF18CD6CEBC2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | A24283CB06A31A27E88714C32F4C3A94 /* PKCCrop.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PKCCrop.swift; sourceTree = ""; }; 67 | A27DB6E4A3CF74B74E3D29E2A3E78C7C /* Pods-PKCCrop_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PKCCrop_Example-dummy.m"; sourceTree = ""; }; 68 | A2E11348A46EB084128F5BA3D7E0BA3F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 69 | A4DDFEEA4142B84E6116217AB4883FB4 /* Pods_PKCCrop_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PKCCrop_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | A903E26281FFEAEFE1C17E498E8C2F60 /* Pods-PKCCrop_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PKCCrop_Tests.debug.xcconfig"; sourceTree = ""; }; 71 | ACDAEDF27CDA6B803DE86E0178BCF1E5 /* PKCCropViewController.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; path = PKCCropViewController.xib; sourceTree = ""; }; 72 | B431FED843EB432FAD7ABB004021C9BC /* Pods-PKCCrop_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PKCCrop_Tests-resources.sh"; sourceTree = ""; }; 73 | CB6E1F197963ABE063E6EB516B6E1A56 /* PKCCrop.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PKCCrop.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74 | CC60EEDE2DA576BFBC0BED7640685069 /* PKCCrop-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PKCCrop-prefix.pch"; sourceTree = ""; }; 75 | CE672951FD65B00E6633776F3261DA4E /* PKCCropViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PKCCropViewController.swift; sourceTree = ""; }; 76 | D5135FD002337F323992E3C02FB53F06 /* Pods-PKCCrop_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PKCCrop_Example.debug.xcconfig"; sourceTree = ""; }; 77 | DF502F0D68FCCB69165B3470B1600777 /* Pods-PKCCrop_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-PKCCrop_Tests.modulemap"; sourceTree = ""; }; 78 | E498AD7079E05706621B0D75AC9E5475 /* PKCCropLineView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PKCCropLineView.swift; sourceTree = ""; }; 79 | EAE61F3001AE9C2365488FBE6B883760 /* PKCCrop.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = PKCCrop.modulemap; sourceTree = ""; }; 80 | F875D9FB7DFB2A0A5163C671E434A6BA /* Pods-PKCCrop_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PKCCrop_Tests-dummy.m"; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | 280AA1F5C6C1668C6D26EE0247955712 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 39DF190435D5E85B4016FE8A141054B2 /* Foundation.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 83C6CE7DC7747DBDAD2B8C5E53F7C290 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | C1108E8AC532ED82EC7E0F110A88890D /* Foundation.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | A9EAD1C374AB8D67EE6D21F75FAE4AE2 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | F11B9C7C7CBB9407C5E839C268758F65 /* Foundation.framework in Frameworks */, 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXFrameworksBuildPhase section */ 109 | 110 | /* Begin PBXGroup section */ 111 | 2D0C1AD4996663132534919BA22623FC /* Pods-PKCCrop_Tests */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 9864E58F8B8E492B89B2BF18CD6CEBC2 /* Info.plist */, 115 | DF502F0D68FCCB69165B3470B1600777 /* Pods-PKCCrop_Tests.modulemap */, 116 | 8DF75849394A6FA6CAF1BC9AA5204562 /* Pods-PKCCrop_Tests-acknowledgements.markdown */, 117 | 31E2CF919670459DC1228CE235BE04D0 /* Pods-PKCCrop_Tests-acknowledgements.plist */, 118 | F875D9FB7DFB2A0A5163C671E434A6BA /* Pods-PKCCrop_Tests-dummy.m */, 119 | 7CFF51F9C7491662F737DF9FCED5F747 /* Pods-PKCCrop_Tests-frameworks.sh */, 120 | B431FED843EB432FAD7ABB004021C9BC /* Pods-PKCCrop_Tests-resources.sh */, 121 | 7C1B9A20FCA7C803BA5BBBD1FF8B890E /* Pods-PKCCrop_Tests-umbrella.h */, 122 | A903E26281FFEAEFE1C17E498E8C2F60 /* Pods-PKCCrop_Tests.debug.xcconfig */, 123 | 8BFD0BEBDBC92B5622B0AB9EB5CB4B57 /* Pods-PKCCrop_Tests.release.xcconfig */, 124 | ); 125 | name = "Pods-PKCCrop_Tests"; 126 | path = "Target Support Files/Pods-PKCCrop_Tests"; 127 | sourceTree = ""; 128 | }; 129 | 38AF2AF738C81D0AD06E703C40D53433 /* PKCCrop */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 5098E8C8E900B9239BDDC92307DF853B /* PKCCrop */, 133 | 3BBFBA13A448D9277615735DE4A899DD /* Support Files */, 134 | ); 135 | name = PKCCrop; 136 | path = ../..; 137 | sourceTree = ""; 138 | }; 139 | 3BBFBA13A448D9277615735DE4A899DD /* Support Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | A2E11348A46EB084128F5BA3D7E0BA3F /* Info.plist */, 143 | EAE61F3001AE9C2365488FBE6B883760 /* PKCCrop.modulemap */, 144 | 5138FA381DC4AB2A1CBA58E7C626BDD5 /* PKCCrop.xcconfig */, 145 | 31EF83E47C569397A90AC431C6729421 /* PKCCrop-dummy.m */, 146 | CC60EEDE2DA576BFBC0BED7640685069 /* PKCCrop-prefix.pch */, 147 | 426AD31E838FDC430FCA9188A1693008 /* PKCCrop-umbrella.h */, 148 | ); 149 | name = "Support Files"; 150 | path = "Example/Pods/Target Support Files/PKCCrop"; 151 | sourceTree = ""; 152 | }; 153 | 5098E8C8E900B9239BDDC92307DF853B /* PKCCrop */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 5492991B683451D80700AAFB6111396E /* Classes */, 157 | ); 158 | path = PKCCrop; 159 | sourceTree = ""; 160 | }; 161 | 5492991B683451D80700AAFB6111396E /* Classes */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | A24283CB06A31A27E88714C32F4C3A94 /* PKCCrop.swift */, 165 | 53C7DF3B9E6B6EFFB35E058D72CAE5DD /* PKCCropHelper.swift */, 166 | E498AD7079E05706621B0D75AC9E5475 /* PKCCropLineView.swift */, 167 | 52CD7E3C0F751888FB5CB6FF36FA6D1F /* PKCCropLineView.xib */, 168 | CE672951FD65B00E6633776F3261DA4E /* PKCCropViewController.swift */, 169 | ACDAEDF27CDA6B803DE86E0178BCF1E5 /* PKCCropViewController.xib */, 170 | 43AFDFD8F95C9E453A1657B692836EDA /* PKCButton.swift */, 171 | 2B20B5D94F2A9F4616341FF3D9D97270 /* UIImageView+.swift */, 172 | 0A21E2FE2804B8889198A44987192D91 /* UIView+.swift */, 173 | ); 174 | path = Classes; 175 | sourceTree = ""; 176 | }; 177 | 6719A7F94D327542B47ADA11CED86D32 /* Pods-PKCCrop_Example */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 236E212F6F98CFDA4452FE5A94D9A6F0 /* Info.plist */, 181 | 25D911C0A7C19FD81A4569A557D8E6C9 /* Pods-PKCCrop_Example.modulemap */, 182 | 42122F7705F8D51FB8E5A00145030342 /* Pods-PKCCrop_Example-acknowledgements.markdown */, 183 | 139C4E729234E56C4878EE45D76519F1 /* Pods-PKCCrop_Example-acknowledgements.plist */, 184 | A27DB6E4A3CF74B74E3D29E2A3E78C7C /* Pods-PKCCrop_Example-dummy.m */, 185 | 722628FA546E503380664DCEA780957A /* Pods-PKCCrop_Example-frameworks.sh */, 186 | 465001315E0C163D757E880BA18E81F6 /* Pods-PKCCrop_Example-resources.sh */, 187 | 778AC436DE144D6F0FBDECF0D8FAF4F1 /* Pods-PKCCrop_Example-umbrella.h */, 188 | D5135FD002337F323992E3C02FB53F06 /* Pods-PKCCrop_Example.debug.xcconfig */, 189 | 93EF8BF355DFCAE6448A0FA3265FC379 /* Pods-PKCCrop_Example.release.xcconfig */, 190 | ); 191 | name = "Pods-PKCCrop_Example"; 192 | path = "Target Support Files/Pods-PKCCrop_Example"; 193 | sourceTree = ""; 194 | }; 195 | 7DB346D0F39D3F0E887471402A8071AB = { 196 | isa = PBXGroup; 197 | children = ( 198 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 199 | AC7B3A6E186B106C51A2916919D23F4A /* Development Pods */, 200 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, 201 | 846C06D6199EC4E9BFA4FCD265EF3F77 /* Products */, 202 | 93CA760C86A4A0D998422A9A3CC772FF /* Targets Support Files */, 203 | ); 204 | sourceTree = ""; 205 | }; 206 | 846C06D6199EC4E9BFA4FCD265EF3F77 /* Products */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | CB6E1F197963ABE063E6EB516B6E1A56 /* PKCCrop.framework */, 210 | A4DDFEEA4142B84E6116217AB4883FB4 /* Pods_PKCCrop_Example.framework */, 211 | 59096F0CF72717DF02C05F84FDD2C8E9 /* Pods_PKCCrop_Tests.framework */, 212 | ); 213 | name = Products; 214 | sourceTree = ""; 215 | }; 216 | 93CA760C86A4A0D998422A9A3CC772FF /* Targets Support Files */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 6719A7F94D327542B47ADA11CED86D32 /* Pods-PKCCrop_Example */, 220 | 2D0C1AD4996663132534919BA22623FC /* Pods-PKCCrop_Tests */, 221 | ); 222 | name = "Targets Support Files"; 223 | sourceTree = ""; 224 | }; 225 | AC7B3A6E186B106C51A2916919D23F4A /* Development Pods */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 38AF2AF738C81D0AD06E703C40D53433 /* PKCCrop */, 229 | ); 230 | name = "Development Pods"; 231 | sourceTree = ""; 232 | }; 233 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | D35AF013A5F0BAD4F32504907A52519E /* iOS */, 237 | ); 238 | name = Frameworks; 239 | sourceTree = ""; 240 | }; 241 | D35AF013A5F0BAD4F32504907A52519E /* iOS */ = { 242 | isa = PBXGroup; 243 | children = ( 244 | 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */, 245 | ); 246 | name = iOS; 247 | sourceTree = ""; 248 | }; 249 | /* End PBXGroup section */ 250 | 251 | /* Begin PBXHeadersBuildPhase section */ 252 | 1F79D905A1734431F6FBA3283C90E3AC /* Headers */ = { 253 | isa = PBXHeadersBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 3BC0D4351690C5568254B432F3936302 /* PKCCrop-umbrella.h in Headers */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 98559C0DC856D7D348F37CE8FB19F85F /* Headers */ = { 261 | isa = PBXHeadersBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | D4E1099C23FCEB12004784821F7AA1CE /* Pods-PKCCrop_Example-umbrella.h in Headers */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | AEE2C3D539916E5ABDD6EC05A2530E79 /* Headers */ = { 269 | isa = PBXHeadersBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | FB8894BDD14725F2E0AFD6862729C548 /* Pods-PKCCrop_Tests-umbrella.h in Headers */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXHeadersBuildPhase section */ 277 | 278 | /* Begin PBXNativeTarget section */ 279 | 0C38E9F7AB6BC55A24E43957EF45C6A0 /* PKCCrop */ = { 280 | isa = PBXNativeTarget; 281 | buildConfigurationList = 646F7A961FFE984218CD1955E315E7F8 /* Build configuration list for PBXNativeTarget "PKCCrop" */; 282 | buildPhases = ( 283 | EB2351437D9DE8E06FF12B7B427F27F4 /* Sources */, 284 | 280AA1F5C6C1668C6D26EE0247955712 /* Frameworks */, 285 | 1F79D905A1734431F6FBA3283C90E3AC /* Headers */, 286 | ); 287 | buildRules = ( 288 | ); 289 | dependencies = ( 290 | ); 291 | name = PKCCrop; 292 | productName = PKCCrop; 293 | productReference = CB6E1F197963ABE063E6EB516B6E1A56 /* PKCCrop.framework */; 294 | productType = "com.apple.product-type.framework"; 295 | }; 296 | 563FC74D775BE38A64B592E7A750297D /* Pods-PKCCrop_Example */ = { 297 | isa = PBXNativeTarget; 298 | buildConfigurationList = 93200537F3E1366346DF2846472B2E7B /* Build configuration list for PBXNativeTarget "Pods-PKCCrop_Example" */; 299 | buildPhases = ( 300 | 89BE541248D931D74D3C17251CF60043 /* Sources */, 301 | 83C6CE7DC7747DBDAD2B8C5E53F7C290 /* Frameworks */, 302 | 98559C0DC856D7D348F37CE8FB19F85F /* Headers */, 303 | ); 304 | buildRules = ( 305 | ); 306 | dependencies = ( 307 | BFC64608426F2864E7D77C052E66AA8C /* PBXTargetDependency */, 308 | ); 309 | name = "Pods-PKCCrop_Example"; 310 | productName = "Pods-PKCCrop_Example"; 311 | productReference = A4DDFEEA4142B84E6116217AB4883FB4 /* Pods_PKCCrop_Example.framework */; 312 | productType = "com.apple.product-type.framework"; 313 | }; 314 | E8E46DE5CBD06C06C0C2C142C15399D0 /* Pods-PKCCrop_Tests */ = { 315 | isa = PBXNativeTarget; 316 | buildConfigurationList = 5C8290F398ECA628D86AFE5CA8FD1040 /* Build configuration list for PBXNativeTarget "Pods-PKCCrop_Tests" */; 317 | buildPhases = ( 318 | 7EC23F716AC88BDB236DD8519B98A7F9 /* Sources */, 319 | A9EAD1C374AB8D67EE6D21F75FAE4AE2 /* Frameworks */, 320 | AEE2C3D539916E5ABDD6EC05A2530E79 /* Headers */, 321 | ); 322 | buildRules = ( 323 | ); 324 | dependencies = ( 325 | ); 326 | name = "Pods-PKCCrop_Tests"; 327 | productName = "Pods-PKCCrop_Tests"; 328 | productReference = 59096F0CF72717DF02C05F84FDD2C8E9 /* Pods_PKCCrop_Tests.framework */; 329 | productType = "com.apple.product-type.framework"; 330 | }; 331 | /* End PBXNativeTarget section */ 332 | 333 | /* Begin PBXProject section */ 334 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 335 | isa = PBXProject; 336 | attributes = { 337 | LastSwiftUpdateCheck = 0830; 338 | LastUpgradeCheck = 0700; 339 | }; 340 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 341 | compatibilityVersion = "Xcode 3.2"; 342 | developmentRegion = English; 343 | hasScannedForEncodings = 0; 344 | knownRegions = ( 345 | en, 346 | ); 347 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 348 | productRefGroup = 846C06D6199EC4E9BFA4FCD265EF3F77 /* Products */; 349 | projectDirPath = ""; 350 | projectRoot = ""; 351 | targets = ( 352 | 0C38E9F7AB6BC55A24E43957EF45C6A0 /* PKCCrop */, 353 | 563FC74D775BE38A64B592E7A750297D /* Pods-PKCCrop_Example */, 354 | E8E46DE5CBD06C06C0C2C142C15399D0 /* Pods-PKCCrop_Tests */, 355 | ); 356 | }; 357 | /* End PBXProject section */ 358 | 359 | /* Begin PBXSourcesBuildPhase section */ 360 | 7EC23F716AC88BDB236DD8519B98A7F9 /* Sources */ = { 361 | isa = PBXSourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | 76E785678C91DC5BF7DDC9849F94D55B /* Pods-PKCCrop_Tests-dummy.m in Sources */, 365 | ); 366 | runOnlyForDeploymentPostprocessing = 0; 367 | }; 368 | 89BE541248D931D74D3C17251CF60043 /* Sources */ = { 369 | isa = PBXSourcesBuildPhase; 370 | buildActionMask = 2147483647; 371 | files = ( 372 | D2D25C7C699B5E60E01B0F92139F65AF /* Pods-PKCCrop_Example-dummy.m in Sources */, 373 | ); 374 | runOnlyForDeploymentPostprocessing = 0; 375 | }; 376 | EB2351437D9DE8E06FF12B7B427F27F4 /* Sources */ = { 377 | isa = PBXSourcesBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | EFB7BADE058AA97EAFCC6208E7ACE2C6 /* PKCButton.swift in Sources */, 381 | 2D999485B038B874732B9AA2A36471FD /* PKCCrop-dummy.m in Sources */, 382 | 483E92D5B7F96E93CF310CEE73511426 /* PKCCrop.swift in Sources */, 383 | 52186C7927933DC9C267C6DE72852536 /* PKCCropHelper.swift in Sources */, 384 | DC2934B775837180D068427376CDECD4 /* PKCCropLineView.swift in Sources */, 385 | 8D9C49578BE3D99E9BE8A87B96ACB283 /* PKCCropLineView.xib in Sources */, 386 | D607B4688263F391B4547C11D1347E59 /* PKCCropViewController.swift in Sources */, 387 | 1756B5325FB958169A81148172EB97CA /* PKCCropViewController.xib in Sources */, 388 | B24BB41ADAEEFBF296F179BF3849E8D5 /* UIImageView+.swift in Sources */, 389 | A0BC6547B77FD59B180BD90D1D4F6DFA /* UIView+.swift in Sources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | /* End PBXSourcesBuildPhase section */ 394 | 395 | /* Begin PBXTargetDependency section */ 396 | BFC64608426F2864E7D77C052E66AA8C /* PBXTargetDependency */ = { 397 | isa = PBXTargetDependency; 398 | name = PKCCrop; 399 | target = 0C38E9F7AB6BC55A24E43957EF45C6A0 /* PKCCrop */; 400 | targetProxy = C14B39EE3CF426EB1691FCC14D61F663 /* PBXContainerItemProxy */; 401 | }; 402 | /* End PBXTargetDependency section */ 403 | 404 | /* Begin XCBuildConfiguration section */ 405 | 266A49D1F732A28BD061E9424312760D /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | baseConfigurationReference = 8BFD0BEBDBC92B5622B0AB9EB5CB4B57 /* Pods-PKCCrop_Tests.release.xcconfig */; 408 | buildSettings = { 409 | CODE_SIGN_IDENTITY = ""; 410 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 412 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 413 | CURRENT_PROJECT_VERSION = 1; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | DEFINES_MODULE = YES; 416 | DYLIB_COMPATIBILITY_VERSION = 1; 417 | DYLIB_CURRENT_VERSION = 1; 418 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 419 | ENABLE_STRICT_OBJC_MSGSEND = YES; 420 | GCC_NO_COMMON_BLOCKS = YES; 421 | INFOPLIST_FILE = "Target Support Files/Pods-PKCCrop_Tests/Info.plist"; 422 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 423 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 425 | MACH_O_TYPE = staticlib; 426 | MODULEMAP_FILE = "Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.modulemap"; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | OTHER_LDFLAGS = ""; 429 | OTHER_LIBTOOLFLAGS = ""; 430 | PODS_ROOT = "$(SRCROOT)"; 431 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 432 | PRODUCT_NAME = Pods_PKCCrop_Tests; 433 | SDKROOT = iphoneos; 434 | SKIP_INSTALL = YES; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | VERSIONING_SYSTEM = "apple-generic"; 437 | VERSION_INFO_PREFIX = ""; 438 | }; 439 | name = Release; 440 | }; 441 | 416A6C287BFF7056C905641A037D1F5F /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | baseConfigurationReference = A903E26281FFEAEFE1C17E498E8C2F60 /* Pods-PKCCrop_Tests.debug.xcconfig */; 444 | buildSettings = { 445 | CODE_SIGN_IDENTITY = ""; 446 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 447 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 448 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 449 | CURRENT_PROJECT_VERSION = 1; 450 | DEBUG_INFORMATION_FORMAT = dwarf; 451 | DEFINES_MODULE = YES; 452 | DYLIB_COMPATIBILITY_VERSION = 1; 453 | DYLIB_CURRENT_VERSION = 1; 454 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | GCC_NO_COMMON_BLOCKS = YES; 457 | INFOPLIST_FILE = "Target Support Files/Pods-PKCCrop_Tests/Info.plist"; 458 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 459 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 461 | MACH_O_TYPE = staticlib; 462 | MODULEMAP_FILE = "Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.modulemap"; 463 | MTL_ENABLE_DEBUG_INFO = YES; 464 | OTHER_LDFLAGS = ""; 465 | OTHER_LIBTOOLFLAGS = ""; 466 | PODS_ROOT = "$(SRCROOT)"; 467 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 468 | PRODUCT_NAME = Pods_PKCCrop_Tests; 469 | SDKROOT = iphoneos; 470 | SKIP_INSTALL = YES; 471 | TARGETED_DEVICE_FAMILY = "1,2"; 472 | VERSIONING_SYSTEM = "apple-generic"; 473 | VERSION_INFO_PREFIX = ""; 474 | }; 475 | name = Debug; 476 | }; 477 | 717E77604BFBB04BEAF56608A1CB2EDE /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ALWAYS_SEARCH_USER_PATHS = NO; 481 | CLANG_ANALYZER_NONNULL = YES; 482 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; 483 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 484 | CLANG_CXX_LIBRARY = "libc++"; 485 | CLANG_ENABLE_MODULES = YES; 486 | CLANG_ENABLE_OBJC_ARC = YES; 487 | CLANG_WARN_BOOL_CONVERSION = YES; 488 | CLANG_WARN_CONSTANT_CONVERSION = YES; 489 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 490 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 491 | CLANG_WARN_EMPTY_BODY = YES; 492 | CLANG_WARN_ENUM_CONVERSION = YES; 493 | CLANG_WARN_INFINITE_RECURSION = YES; 494 | CLANG_WARN_INT_CONVERSION = YES; 495 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 496 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 497 | CLANG_WARN_UNREACHABLE_CODE = YES; 498 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 499 | CODE_SIGNING_REQUIRED = NO; 500 | COPY_PHASE_STRIP = YES; 501 | ENABLE_NS_ASSERTIONS = NO; 502 | GCC_C_LANGUAGE_STANDARD = gnu99; 503 | GCC_PREPROCESSOR_DEFINITIONS = ( 504 | "POD_CONFIGURATION_RELEASE=1", 505 | "$(inherited)", 506 | ); 507 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 508 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 509 | GCC_WARN_UNDECLARED_SELECTOR = YES; 510 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 511 | GCC_WARN_UNUSED_FUNCTION = YES; 512 | GCC_WARN_UNUSED_VARIABLE = YES; 513 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 514 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 515 | STRIP_INSTALLED_PRODUCT = NO; 516 | SYMROOT = "${SRCROOT}/../build"; 517 | VALIDATE_PRODUCT = YES; 518 | }; 519 | name = Release; 520 | }; 521 | A4CBFD99AC0D7640DAFDAC7E378C7A16 /* Release */ = { 522 | isa = XCBuildConfiguration; 523 | baseConfigurationReference = 93EF8BF355DFCAE6448A0FA3265FC379 /* Pods-PKCCrop_Example.release.xcconfig */; 524 | buildSettings = { 525 | CODE_SIGN_IDENTITY = ""; 526 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 527 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 528 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 529 | CURRENT_PROJECT_VERSION = 1; 530 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 531 | DEFINES_MODULE = YES; 532 | DYLIB_COMPATIBILITY_VERSION = 1; 533 | DYLIB_CURRENT_VERSION = 1; 534 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 535 | ENABLE_STRICT_OBJC_MSGSEND = YES; 536 | GCC_NO_COMMON_BLOCKS = YES; 537 | INFOPLIST_FILE = "Target Support Files/Pods-PKCCrop_Example/Info.plist"; 538 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 539 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 541 | MACH_O_TYPE = staticlib; 542 | MODULEMAP_FILE = "Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.modulemap"; 543 | MTL_ENABLE_DEBUG_INFO = NO; 544 | OTHER_LDFLAGS = ""; 545 | OTHER_LIBTOOLFLAGS = ""; 546 | PODS_ROOT = "$(SRCROOT)"; 547 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 548 | PRODUCT_NAME = Pods_PKCCrop_Example; 549 | SDKROOT = iphoneos; 550 | SKIP_INSTALL = YES; 551 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 552 | SWIFT_VERSION = 3.0; 553 | TARGETED_DEVICE_FAMILY = "1,2"; 554 | VERSIONING_SYSTEM = "apple-generic"; 555 | VERSION_INFO_PREFIX = ""; 556 | }; 557 | name = Release; 558 | }; 559 | A6A03C9B1314C05BD3C2FBD3F65EDF83 /* Debug */ = { 560 | isa = XCBuildConfiguration; 561 | buildSettings = { 562 | ALWAYS_SEARCH_USER_PATHS = NO; 563 | CLANG_ANALYZER_NONNULL = YES; 564 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; 565 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 566 | CLANG_CXX_LIBRARY = "libc++"; 567 | CLANG_ENABLE_MODULES = YES; 568 | CLANG_ENABLE_OBJC_ARC = YES; 569 | CLANG_WARN_BOOL_CONVERSION = YES; 570 | CLANG_WARN_CONSTANT_CONVERSION = YES; 571 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 572 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 573 | CLANG_WARN_EMPTY_BODY = YES; 574 | CLANG_WARN_ENUM_CONVERSION = YES; 575 | CLANG_WARN_INFINITE_RECURSION = YES; 576 | CLANG_WARN_INT_CONVERSION = YES; 577 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 578 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 579 | CLANG_WARN_UNREACHABLE_CODE = YES; 580 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 581 | CODE_SIGNING_REQUIRED = NO; 582 | COPY_PHASE_STRIP = NO; 583 | ENABLE_TESTABILITY = YES; 584 | GCC_C_LANGUAGE_STANDARD = gnu99; 585 | GCC_DYNAMIC_NO_PIC = NO; 586 | GCC_OPTIMIZATION_LEVEL = 0; 587 | GCC_PREPROCESSOR_DEFINITIONS = ( 588 | "POD_CONFIGURATION_DEBUG=1", 589 | "DEBUG=1", 590 | "$(inherited)", 591 | ); 592 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 593 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 594 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 595 | GCC_WARN_UNDECLARED_SELECTOR = YES; 596 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 597 | GCC_WARN_UNUSED_FUNCTION = YES; 598 | GCC_WARN_UNUSED_VARIABLE = YES; 599 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 600 | ONLY_ACTIVE_ARCH = YES; 601 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 602 | STRIP_INSTALLED_PRODUCT = NO; 603 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 604 | SYMROOT = "${SRCROOT}/../build"; 605 | }; 606 | name = Debug; 607 | }; 608 | B00D632D74329DDDF0728160F85BFA95 /* Debug */ = { 609 | isa = XCBuildConfiguration; 610 | baseConfigurationReference = 5138FA381DC4AB2A1CBA58E7C626BDD5 /* PKCCrop.xcconfig */; 611 | buildSettings = { 612 | CODE_SIGN_IDENTITY = ""; 613 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 614 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 615 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 616 | CURRENT_PROJECT_VERSION = 1; 617 | DEBUG_INFORMATION_FORMAT = dwarf; 618 | DEFINES_MODULE = YES; 619 | DYLIB_COMPATIBILITY_VERSION = 1; 620 | DYLIB_CURRENT_VERSION = 1; 621 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 622 | ENABLE_STRICT_OBJC_MSGSEND = YES; 623 | GCC_NO_COMMON_BLOCKS = YES; 624 | GCC_PREFIX_HEADER = "Target Support Files/PKCCrop/PKCCrop-prefix.pch"; 625 | INFOPLIST_FILE = "Target Support Files/PKCCrop/Info.plist"; 626 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 627 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 628 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 629 | MODULEMAP_FILE = "Target Support Files/PKCCrop/PKCCrop.modulemap"; 630 | MTL_ENABLE_DEBUG_INFO = YES; 631 | PRODUCT_NAME = PKCCrop; 632 | SDKROOT = iphoneos; 633 | SKIP_INSTALL = YES; 634 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 635 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 636 | SWIFT_VERSION = 3.0; 637 | TARGETED_DEVICE_FAMILY = "1,2"; 638 | VERSIONING_SYSTEM = "apple-generic"; 639 | VERSION_INFO_PREFIX = ""; 640 | }; 641 | name = Debug; 642 | }; 643 | E702F88AB6886ED4E88B565D39B0E156 /* Release */ = { 644 | isa = XCBuildConfiguration; 645 | baseConfigurationReference = 5138FA381DC4AB2A1CBA58E7C626BDD5 /* PKCCrop.xcconfig */; 646 | buildSettings = { 647 | CODE_SIGN_IDENTITY = ""; 648 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 649 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 650 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 651 | CURRENT_PROJECT_VERSION = 1; 652 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 653 | DEFINES_MODULE = YES; 654 | DYLIB_COMPATIBILITY_VERSION = 1; 655 | DYLIB_CURRENT_VERSION = 1; 656 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 657 | ENABLE_STRICT_OBJC_MSGSEND = YES; 658 | GCC_NO_COMMON_BLOCKS = YES; 659 | GCC_PREFIX_HEADER = "Target Support Files/PKCCrop/PKCCrop-prefix.pch"; 660 | INFOPLIST_FILE = "Target Support Files/PKCCrop/Info.plist"; 661 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 662 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 663 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 664 | MODULEMAP_FILE = "Target Support Files/PKCCrop/PKCCrop.modulemap"; 665 | MTL_ENABLE_DEBUG_INFO = NO; 666 | PRODUCT_NAME = PKCCrop; 667 | SDKROOT = iphoneos; 668 | SKIP_INSTALL = YES; 669 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 670 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 671 | SWIFT_VERSION = 3.0; 672 | TARGETED_DEVICE_FAMILY = "1,2"; 673 | VERSIONING_SYSTEM = "apple-generic"; 674 | VERSION_INFO_PREFIX = ""; 675 | }; 676 | name = Release; 677 | }; 678 | F63F0728793C5F62996E480397E5177B /* Debug */ = { 679 | isa = XCBuildConfiguration; 680 | baseConfigurationReference = D5135FD002337F323992E3C02FB53F06 /* Pods-PKCCrop_Example.debug.xcconfig */; 681 | buildSettings = { 682 | CODE_SIGN_IDENTITY = ""; 683 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 684 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 685 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 686 | CURRENT_PROJECT_VERSION = 1; 687 | DEBUG_INFORMATION_FORMAT = dwarf; 688 | DEFINES_MODULE = YES; 689 | DYLIB_COMPATIBILITY_VERSION = 1; 690 | DYLIB_CURRENT_VERSION = 1; 691 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 692 | ENABLE_STRICT_OBJC_MSGSEND = YES; 693 | GCC_NO_COMMON_BLOCKS = YES; 694 | INFOPLIST_FILE = "Target Support Files/Pods-PKCCrop_Example/Info.plist"; 695 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 696 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 697 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 698 | MACH_O_TYPE = staticlib; 699 | MODULEMAP_FILE = "Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.modulemap"; 700 | MTL_ENABLE_DEBUG_INFO = YES; 701 | OTHER_LDFLAGS = ""; 702 | OTHER_LIBTOOLFLAGS = ""; 703 | PODS_ROOT = "$(SRCROOT)"; 704 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 705 | PRODUCT_NAME = Pods_PKCCrop_Example; 706 | SDKROOT = iphoneos; 707 | SKIP_INSTALL = YES; 708 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 709 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 710 | SWIFT_VERSION = 3.0; 711 | TARGETED_DEVICE_FAMILY = "1,2"; 712 | VERSIONING_SYSTEM = "apple-generic"; 713 | VERSION_INFO_PREFIX = ""; 714 | }; 715 | name = Debug; 716 | }; 717 | /* End XCBuildConfiguration section */ 718 | 719 | /* Begin XCConfigurationList section */ 720 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 721 | isa = XCConfigurationList; 722 | buildConfigurations = ( 723 | A6A03C9B1314C05BD3C2FBD3F65EDF83 /* Debug */, 724 | 717E77604BFBB04BEAF56608A1CB2EDE /* Release */, 725 | ); 726 | defaultConfigurationIsVisible = 0; 727 | defaultConfigurationName = Release; 728 | }; 729 | 5C8290F398ECA628D86AFE5CA8FD1040 /* Build configuration list for PBXNativeTarget "Pods-PKCCrop_Tests" */ = { 730 | isa = XCConfigurationList; 731 | buildConfigurations = ( 732 | 416A6C287BFF7056C905641A037D1F5F /* Debug */, 733 | 266A49D1F732A28BD061E9424312760D /* Release */, 734 | ); 735 | defaultConfigurationIsVisible = 0; 736 | defaultConfigurationName = Release; 737 | }; 738 | 646F7A961FFE984218CD1955E315E7F8 /* Build configuration list for PBXNativeTarget "PKCCrop" */ = { 739 | isa = XCConfigurationList; 740 | buildConfigurations = ( 741 | B00D632D74329DDDF0728160F85BFA95 /* Debug */, 742 | E702F88AB6886ED4E88B565D39B0E156 /* Release */, 743 | ); 744 | defaultConfigurationIsVisible = 0; 745 | defaultConfigurationName = Release; 746 | }; 747 | 93200537F3E1366346DF2846472B2E7B /* Build configuration list for PBXNativeTarget "Pods-PKCCrop_Example" */ = { 748 | isa = XCConfigurationList; 749 | buildConfigurations = ( 750 | F63F0728793C5F62996E480397E5177B /* Debug */, 751 | A4CBFD99AC0D7640DAFDAC7E378C7A16 /* Release */, 752 | ); 753 | defaultConfigurationIsVisible = 0; 754 | defaultConfigurationName = Release; 755 | }; 756 | /* End XCConfigurationList section */ 757 | }; 758 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 759 | } 760 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/PKCCrop-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_PKCCrop : NSObject 3 | @end 4 | @implementation PodsDummy_PKCCrop 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/PKCCrop-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/PKCCrop-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double PKCCropVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char PKCCropVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/PKCCrop.modulemap: -------------------------------------------------------------------------------- 1 | framework module PKCCrop { 2 | umbrella header "PKCCrop-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/PKCCrop/PKCCrop.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/PKCCrop 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## PKCCrop 5 | 6 | Copyright (c) 2017 pikachu987 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2017 pikachu987 <pikachu77769@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | PKCCrop 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PKCCrop_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PKCCrop_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Copies the dSYM of a vendored framework 58 | install_dsym() { 59 | local source="$1" 60 | if [ -r "$source" ]; then 61 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 62 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 63 | fi 64 | } 65 | 66 | # Signs a framework with the provided identity 67 | code_sign_if_enabled() { 68 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 69 | # Use the current code_sign_identitiy 70 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 71 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 72 | 73 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 74 | code_sign_cmd="$code_sign_cmd &" 75 | fi 76 | echo "$code_sign_cmd" 77 | eval "$code_sign_cmd" 78 | fi 79 | } 80 | 81 | # Strip invalid architectures 82 | strip_invalid_archs() { 83 | binary="$1" 84 | # Get architectures for current file 85 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 86 | stripped="" 87 | for arch in $archs; do 88 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 89 | # Strip non-valid architectures in-place 90 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 91 | stripped="$stripped $arch" 92 | fi 93 | done 94 | if [[ "$stripped" ]]; then 95 | echo "Stripped $binary of architectures:$stripped" 96 | fi 97 | } 98 | 99 | 100 | if [[ "$CONFIGURATION" == "Debug" ]]; then 101 | install_framework "$BUILT_PRODUCTS_DIR/PKCCrop/PKCCrop.framework" 102 | fi 103 | if [[ "$CONFIGURATION" == "Release" ]]; then 104 | install_framework "$BUILT_PRODUCTS_DIR/PKCCrop/PKCCrop.framework" 105 | fi 106 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 107 | wait 108 | fi 109 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | 3) 22 | TARGET_DEVICE_ARGS="--target-device tv" 23 | ;; 24 | 4) 25 | TARGET_DEVICE_ARGS="--target-device watch" 26 | ;; 27 | *) 28 | TARGET_DEVICE_ARGS="--target-device mac" 29 | ;; 30 | esac 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync --delete -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 58 | rsync --delete -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" || true 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "${PODS_ROOT}*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_PKCCrop_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_PKCCrop_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop/PKCCrop.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "PKCCrop" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_PKCCrop_Example { 2 | umbrella header "Pods-PKCCrop_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Example/Pods-PKCCrop_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop/PKCCrop.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "PKCCrop" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PKCCrop_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PKCCrop_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Copies the dSYM of a vendored framework 58 | install_dsym() { 59 | local source="$1" 60 | if [ -r "$source" ]; then 61 | echo "rsync --delete -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 62 | rsync --delete -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 63 | fi 64 | } 65 | 66 | # Signs a framework with the provided identity 67 | code_sign_if_enabled() { 68 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 69 | # Use the current code_sign_identitiy 70 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 71 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 72 | 73 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 74 | code_sign_cmd="$code_sign_cmd &" 75 | fi 76 | echo "$code_sign_cmd" 77 | eval "$code_sign_cmd" 78 | fi 79 | } 80 | 81 | # Strip invalid architectures 82 | strip_invalid_archs() { 83 | binary="$1" 84 | # Get architectures for current file 85 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 86 | stripped="" 87 | for arch in $archs; do 88 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 89 | # Strip non-valid architectures in-place 90 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 91 | stripped="$stripped $arch" 92 | fi 93 | done 94 | if [[ "$stripped" ]]; then 95 | echo "Stripped $binary of architectures:$stripped" 96 | fi 97 | } 98 | 99 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 100 | wait 101 | fi 102 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | 3) 22 | TARGET_DEVICE_ARGS="--target-device tv" 23 | ;; 24 | 4) 25 | TARGET_DEVICE_ARGS="--target-device watch" 26 | ;; 27 | *) 28 | TARGET_DEVICE_ARGS="--target-device mac" 29 | ;; 30 | esac 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync --delete -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 58 | rsync --delete -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" || true 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync --delete -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "${PODS_ROOT}*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_PKCCrop_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_PKCCrop_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop/PKCCrop.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_PKCCrop_Tests { 2 | umbrella header "Pods-PKCCrop_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-PKCCrop_Tests/Pods-PKCCrop_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/PKCCrop/PKCCrop.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import PKCCrop 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 pikachu987 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /PKCCrop.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'PKCCrop' 3 | s.version = '0.2.4' 4 | s.summary = 'Images crop' 5 | s.description = 'There are many options that can be used to easily put images into crops.' 6 | s.homepage = 'https://github.com/pikachu987/PKCCrop' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.author = { 'pikachu987' => 'pikachu987@naver.com' } 9 | s.source = { :git => 'https://github.com/pikachu987/PKCCrop.git', :tag => s.version.to_s } 10 | s.ios.deployment_target = '8.0' 11 | s.source_files = 'PKCCrop/Classes/*' 12 | end 13 | -------------------------------------------------------------------------------- /PKCCrop/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/.gitkeep -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_bottom_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_bottom_left.png -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_bottom_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_bottom_right.png -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_rotate_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_rotate_left.png -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_rotate_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_rotate_right.png -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_top_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_top_left.png -------------------------------------------------------------------------------- /PKCCrop/Assets/pkc_crop_top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Assets/pkc_crop_top_right.png -------------------------------------------------------------------------------- /PKCCrop/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/PKCCrop/Classes/.gitkeep -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PKCButton.swift 3 | // Pods 4 | // 5 | // Created by Kim Guanho on 2017. 8. 26.. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class PKCButton: UIButton { 12 | var xView: UIView? 13 | var yView: UIView? 14 | 15 | private let maxSize: CGFloat = 36 16 | private let minSize: CGFloat = 2 17 | override func awakeFromNib() { 18 | super.awakeFromNib() 19 | let xView = UIView(frame: .zero) 20 | xView.backgroundColor = .white 21 | xView.isUserInteractionEnabled = false 22 | xView.translatesAutoresizingMaskIntoConstraints = false 23 | self.addSubview(xView) 24 | xView.widthConst(self.maxSize) 25 | xView.heightConst(self.minSize) 26 | self.xView = xView 27 | 28 | let yView = UIView(frame: .zero) 29 | yView.backgroundColor = .white 30 | yView.isUserInteractionEnabled = false 31 | yView.translatesAutoresizingMaskIntoConstraints = false 32 | self.addSubview(yView) 33 | yView.widthConst(self.minSize) 34 | yView.heightConst(self.maxSize) 35 | self.yView = yView 36 | } 37 | 38 | private func attributed(_ view: UIView, attr1: NSLayoutAttribute, attr2: NSLayoutAttribute){ 39 | self.addConstraint(NSLayoutConstraint(item: self, attribute: attr1, relatedBy: .equal, toItem: view, attribute: attr2, multiplier: 1, constant: 0)) 40 | } 41 | 42 | 43 | func leftTop(){ 44 | guard let xView = self.xView, let yView = self.yView else { 45 | return 46 | } 47 | self.attributed(xView, attr1: .top, attr2: .top) 48 | self.attributed(xView, attr1: .leading, attr2: .leading) 49 | self.attributed(yView, attr1: .top, attr2: .top) 50 | self.attributed(yView, attr1: .leading, attr2: .leading) 51 | } 52 | 53 | func rightTop(){ 54 | guard let xView = self.xView, let yView = self.yView else { 55 | return 56 | } 57 | self.attributed(xView, attr1: .top, attr2: .top) 58 | self.attributed(xView, attr1: .trailing, attr2: .trailing) 59 | self.attributed(yView, attr1: .top, attr2: .top) 60 | self.attributed(yView, attr1: .trailing, attr2: .trailing) 61 | } 62 | 63 | func leftBottom(){ 64 | guard let xView = self.xView, let yView = self.yView else { 65 | return 66 | } 67 | self.attributed(xView, attr1: .bottom, attr2: .bottom) 68 | self.attributed(xView, attr1: .leading, attr2: .leading) 69 | self.attributed(yView, attr1: .bottom, attr2: .bottom) 70 | self.attributed(yView, attr1: .leading, attr2: .leading) 71 | } 72 | 73 | func rightBottom(){ 74 | guard let xView = self.xView, let yView = self.yView else { 75 | return 76 | } 77 | self.attributed(xView, attr1: .bottom, attr2: .bottom) 78 | self.attributed(xView, attr1: .trailing, attr2: .trailing) 79 | self.attributed(yView, attr1: .bottom, attr2: .bottom) 80 | self.attributed(yView, attr1: .trailing, attr2: .trailing) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCrop.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | import UIKit 22 | 23 | public class PKCCrop: NSObject { 24 | 25 | 26 | public func cropViewController(_ image: UIImage, tag: Int = 0) -> PKCCropViewController{ 27 | let pkcCropVC = PKCCropViewController(image, tag: tag) 28 | return pkcCropVC 29 | } 30 | 31 | 32 | 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCropHelper.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | import UIKit 22 | 23 | 24 | public enum PKCCropLineType{ 25 | case show, hide, `default` 26 | } 27 | 28 | 29 | public class PKCCropHelper{ 30 | public static let shared = PKCCropHelper() 31 | 32 | public var isNavigationBarShow = false 33 | public var lineType: PKCCropLineType = .default 34 | public var maskAlpha: CGFloat = 0.4 35 | public var barTintColor: UIColor = UIColor(red: 205/255, green: 205/255, blue: 205/255, alpha: 1) 36 | public var tintColor: UIColor = UIColor(red: 0, green: 0.4, blue: 1, alpha: 1) 37 | 38 | public var isDegressShow = true 39 | public var degressBeforeImage: UIImage? = nil 40 | public var degressAfterImage: UIImage? = nil 41 | 42 | var isCropRate = false 43 | var isCircle = false 44 | 45 | let minSize: CGFloat = 120 46 | 47 | private init() { } 48 | } 49 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCropLineView.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | import UIKit 22 | 23 | 24 | protocol PKCCropLineDelegate: class { 25 | func pkcCropLineMask(_ frame: CGRect) 26 | } 27 | 28 | class PKCCropLineView: UIView { 29 | weak var delegate: PKCCropLineDelegate? 30 | 31 | private var containerView: UIView! 32 | 33 | @IBOutlet private weak var lineView: UIView! 34 | @IBOutlet private weak var subLineView: UIView! 35 | 36 | @IBOutlet private weak var leftTopButton: PKCButton! 37 | @IBOutlet private weak var leftBottomButton: PKCButton! 38 | @IBOutlet private weak var rightTopButton: PKCButton! 39 | @IBOutlet private weak var rightBottomButton: PKCButton! 40 | @IBOutlet private weak var topButton: UIButton! 41 | @IBOutlet private weak var bottomTopButton: UIButton! 42 | @IBOutlet private weak var leftButton: UIButton! 43 | @IBOutlet private weak var rightButton: UIButton! 44 | @IBOutlet private weak var centerButton: UIButton! 45 | 46 | 47 | @IBOutlet private weak var topConst: NSLayoutConstraint! 48 | @IBOutlet private weak var leftConst: NSLayoutConstraint! 49 | @IBOutlet private weak var rightConst: NSLayoutConstraint! 50 | @IBOutlet private weak var bottomConst: NSLayoutConstraint! 51 | 52 | private var touchPoint: CGPoint? = nil 53 | 54 | 55 | @IBOutlet private weak var ratioConst: NSLayoutConstraint! 56 | @IBOutlet private weak var limitTopConst: NSLayoutConstraint! 57 | @IBOutlet private weak var limitLeftConst: NSLayoutConstraint! 58 | @IBOutlet private weak var limitRightConst: NSLayoutConstraint! 59 | @IBOutlet private weak var limitBottomConst: NSLayoutConstraint! 60 | 61 | @IBOutlet private weak var minHeightConst: NSLayoutConstraint! 62 | @IBOutlet private weak var minWidthConst: NSLayoutConstraint! 63 | 64 | override init(frame: CGRect) { 65 | super.init(frame: frame) 66 | self.commonInitialization() 67 | } 68 | 69 | required init?(coder aDecoder: NSCoder) { 70 | super.init(coder: aDecoder) 71 | self.commonInitialization() 72 | } 73 | 74 | private func commonInitialization(){ 75 | self.containerView = Bundle.init(for: PKCCrop.self).loadNibNamed("PKCCropLineView", owner: self, options: nil)?.first as! UIView 76 | self.containerView.frame = self.bounds 77 | self.containerView.addFullConstraints(self) 78 | self.initVars() 79 | } 80 | 81 | private func initVars(){ 82 | self.backgroundColor = .clear 83 | self.containerView.backgroundColor = .clear 84 | self.lineView.backgroundColor = .clear 85 | self.subLineView.backgroundColor = .clear 86 | 87 | self.subLineView.alpha = PKCCropHelper.shared.lineType == .show ? 1 : 0 88 | 89 | if !PKCCropHelper.shared.isCropRate && !PKCCropHelper.shared.isCircle{ 90 | self.ratioConst.isActive = false 91 | } 92 | 93 | self.minHeightConst.constant = PKCCropHelper.shared.minSize 94 | self.minWidthConst.constant = PKCCropHelper.shared.minSize 95 | 96 | DispatchQueue.main.async{ 97 | self.leftTopButton.leftTop() 98 | self.rightTopButton.rightTop() 99 | self.leftBottomButton.leftBottom() 100 | self.rightBottomButton.rightBottom() 101 | } 102 | } 103 | 104 | 105 | private func makeMask(){ 106 | self.layoutIfNeeded() 107 | guard let frame = self.superview?.convert(self.lineView.frame, to: nil) else { 108 | return 109 | } 110 | self.delegate?.pkcCropLineMask(CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.width, height: frame.height)) 111 | } 112 | 113 | func cropSize() -> CGRect{ 114 | return self.lineView.frame 115 | } 116 | 117 | func initLineFrame(){ 118 | let paddingX = (self.frame.width - PKCCropHelper.shared.minSize - 80 - 2)/2 119 | let paddingY = (self.frame.height - PKCCropHelper.shared.minSize - 80 - 2)/2 120 | self.leftConst.constant = paddingX 121 | self.rightConst.constant = paddingX 122 | self.topConst.constant = paddingY 123 | self.bottomConst.constant = paddingY 124 | } 125 | 126 | func imageViewSize(_ frame: CGRect){ 127 | let limitX = frame.origin.x + 2 128 | let limitY = frame.origin.y + 2 129 | 130 | self.limitLeftConst.constant = limitX > 0 ? limitX : 2 131 | self.limitRightConst.constant = limitX > 0 ? limitX : 2 132 | self.limitTopConst.constant = limitY > 0 ? limitY : 2 133 | self.limitBottomConst.constant = limitY > 0 ? limitY : 2 134 | 135 | if self.leftConst.constant < self.limitLeftConst.constant - 2{ 136 | self.leftConst.constant = self.limitLeftConst.constant - 2 137 | } 138 | if self.rightConst.constant < self.limitRightConst.constant - 2{ 139 | self.rightConst.constant = self.limitRightConst.constant - 2 140 | } 141 | if self.topConst.constant < self.limitTopConst.constant - 2{ 142 | self.topConst.constant = self.limitTopConst.constant - 2 143 | } 144 | if self.bottomConst.constant < self.limitBottomConst.constant - 2{ 145 | self.bottomConst.constant = self.limitBottomConst.constant - 2 146 | } 147 | 148 | self.makeMask() 149 | } 150 | 151 | 152 | 153 | 154 | 155 | 156 | override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { 157 | if self.leftTopButton.frame.contains(point){ 158 | return true 159 | }else if self.leftBottomButton.frame.contains(point){ 160 | return true 161 | }else if self.rightTopButton.frame.contains(point){ 162 | return true 163 | }else if self.rightBottomButton.frame.contains(point){ 164 | return true 165 | }else if self.topButton.frame.contains(point){ 166 | return true 167 | }else if self.bottomTopButton.frame.contains(point){ 168 | return true 169 | }else if self.leftButton.frame.contains(point){ 170 | return true 171 | }else if self.rightButton.frame.contains(point){ 172 | return true 173 | }else if self.centerButton.frame.contains(point){ 174 | return true 175 | }else{ 176 | return false 177 | } 178 | } 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | // - MARK Drag Action 194 | 195 | 196 | 197 | 198 | @IBAction private func touchUpAction(_ sender: UIButton, forEvent event: UIEvent){ 199 | self.touchPoint = nil 200 | if PKCCropHelper.shared.lineType == .default{ 201 | self.subLineView.alpha = 1 202 | UIView.animate(withDuration: 0.3, animations: { 203 | self.subLineView.alpha = 0 204 | }) 205 | } 206 | } 207 | 208 | @IBAction private func touchDownAction(_ sender: UIButton, forEvent event: UIEvent){ 209 | if let touch = event.touches(for: sender)?.first { 210 | self.touchPoint = touch.previousLocation(in: self) 211 | if PKCCropHelper.shared.lineType == .default{ 212 | self.subLineView.alpha = 0 213 | UIView.animate(withDuration: 0.3, animations: { 214 | self.subLineView.alpha = 1 215 | }) 216 | } 217 | } 218 | } 219 | 220 | 221 | 222 | 223 | 224 | @IBAction private func centerDragAction(_ sender: UIButton, forEvent event: UIEvent) { 225 | guard let touchPoint = self.touchPoint else { 226 | return 227 | } 228 | if let touch = event.touches(for: sender)?.first { 229 | let currentPoint = touch.previousLocation(in: self) 230 | 231 | let minusYPoint = currentPoint.y - touchPoint.y 232 | let minusXPoint = currentPoint.x - touchPoint.x 233 | 234 | let topConst = self.topConst.constant + minusYPoint 235 | let bottomConst = self.bottomConst.constant - minusYPoint 236 | let leftConst = self.leftConst.constant + minusXPoint 237 | let rightConst = self.rightConst.constant - minusXPoint 238 | 239 | if topConst >= self.limitTopConst.constant - 2 && bottomConst >= self.limitBottomConst.constant - 2{ 240 | self.topConst.constant = topConst 241 | self.bottomConst.constant = bottomConst 242 | } 243 | if leftConst >= self.limitLeftConst.constant - 2 && rightConst >= self.limitRightConst.constant - 2{ 244 | self.leftConst.constant = leftConst 245 | self.rightConst.constant = rightConst 246 | } 247 | 248 | 249 | // if topConst >= self.limitTopConst.constant - 2{ 250 | // self.topConst.constant = topConst 251 | // self.bottomConst.constant = bottomConst 252 | // }else if bottomConst >= self.limitBottomConst.constant - 2{ 253 | // self.topConst.constant = topConst 254 | // self.bottomConst.constant = bottomConst 255 | // } 256 | // if rightConst >= self.limitRightConst.constant - 2{ 257 | // self.leftConst.constant = leftConst 258 | // self.rightConst.constant = rightConst 259 | // }else if leftConst >= self.limitLeftConst.constant - 2{ 260 | // self.leftConst.constant = leftConst 261 | // self.rightConst.constant = rightConst 262 | // } 263 | 264 | self.touchPoint = currentPoint 265 | self.makeMask() 266 | } 267 | } 268 | 269 | @IBAction private func topDragAction(_ sender: UIButton, forEvent event: UIEvent) { 270 | if PKCCropHelper.shared.isCircle || PKCCropHelper.shared.isCropRate{ 271 | return 272 | } 273 | guard let touchPoint = self.touchPoint else { 274 | return 275 | } 276 | if let touch = event.touches(for: sender)?.first { 277 | let currentPoint = touch.previousLocation(in: self) 278 | 279 | let minusYPoint = currentPoint.y - touchPoint.y 280 | let topConst = self.topConst.constant + minusYPoint 281 | let limitYConst = (self.bounds.height - (self.bottomConst.constant + topConst + PKCCropHelper.shared.minSize)) 282 | 283 | if topConst >= 0 && minusYPoint > 0 && limitYConst > 0{ 284 | self.topConst.constant = topConst 285 | }else if topConst >= 0 && minusYPoint <= 0 && self.limitTopConst.constant <= topConst{ 286 | self.topConst.constant = topConst 287 | } 288 | 289 | self.touchPoint = currentPoint 290 | self.makeMask() 291 | } 292 | } 293 | 294 | @IBAction private func bottomDragAction(_ sender: UIButton, forEvent event: UIEvent) { 295 | if PKCCropHelper.shared.isCircle || PKCCropHelper.shared.isCropRate{ 296 | return 297 | } 298 | guard let touchPoint = self.touchPoint else { 299 | return 300 | } 301 | if let touch = event.touches(for: sender)?.first { 302 | let currentPoint = touch.previousLocation(in: self) 303 | 304 | let minusYPoint = currentPoint.y - touchPoint.y 305 | let bottomConst = self.bottomConst.constant - minusYPoint 306 | let limitYConst = (self.bounds.height - (self.topConst.constant + bottomConst + PKCCropHelper.shared.minSize)) 307 | 308 | if bottomConst >= 0 && minusYPoint < 0 && limitYConst > 0{ 309 | self.bottomConst.constant = bottomConst 310 | }else if bottomConst >= 0 && minusYPoint >= 0 && self.limitBottomConst.constant <= bottomConst{ 311 | self.bottomConst.constant = bottomConst 312 | } 313 | 314 | self.touchPoint = currentPoint 315 | self.makeMask() 316 | } 317 | } 318 | 319 | @IBAction private func leftDragAction(_ sender: UIButton, forEvent event: UIEvent) { 320 | if PKCCropHelper.shared.isCircle || PKCCropHelper.shared.isCropRate{ 321 | return 322 | } 323 | guard let touchPoint = self.touchPoint else { 324 | return 325 | } 326 | if let touch = event.touches(for: sender)?.first { 327 | let currentPoint = touch.previousLocation(in: self) 328 | 329 | let minusXPoint = currentPoint.x - touchPoint.x 330 | let leftConst = self.leftConst.constant + minusXPoint 331 | let limitXConst = (self.bounds.width - (self.rightConst.constant + leftConst + PKCCropHelper.shared.minSize)) 332 | 333 | if leftConst >= 0 && minusXPoint > 0 && limitXConst > 0{ 334 | self.leftConst.constant = leftConst 335 | }else if leftConst >= 0 && minusXPoint <= 0 && self.limitLeftConst.constant <= leftConst{ 336 | self.leftConst.constant = leftConst 337 | } 338 | 339 | self.touchPoint = currentPoint 340 | self.makeMask() 341 | } 342 | } 343 | 344 | 345 | 346 | @IBAction private func rightDragAction(_ sender: UIButton, forEvent event: UIEvent) { 347 | if PKCCropHelper.shared.isCircle || PKCCropHelper.shared.isCropRate{ 348 | return 349 | } 350 | guard let touchPoint = self.touchPoint else { 351 | return 352 | } 353 | if let touch = event.touches(for: sender)?.first { 354 | let currentPoint = touch.previousLocation(in: self) 355 | 356 | let minusXPoint = currentPoint.x - touchPoint.x 357 | let rightConst = self.rightConst.constant - minusXPoint 358 | let limitXConst = (self.bounds.width - (self.leftConst.constant + rightConst + PKCCropHelper.shared.minSize)) 359 | 360 | if rightConst >= 0 && minusXPoint < 0 && limitXConst > 0{ 361 | self.rightConst.constant = rightConst 362 | }else if rightConst >= 0 && minusXPoint >= 0 && self.limitRightConst.constant <= rightConst{ 363 | self.rightConst.constant = rightConst 364 | } 365 | 366 | self.touchPoint = currentPoint 367 | self.makeMask() 368 | } 369 | } 370 | 371 | 372 | @IBAction private func leftTopDragAction(_ sender: UIButton, forEvent event: UIEvent) { 373 | guard let touchPoint = self.touchPoint else { 374 | return 375 | } 376 | if let touch = event.touches(for: sender)?.first { 377 | let currentPoint = touch.previousLocation(in: self) 378 | 379 | let minusYPoint = currentPoint.y - touchPoint.y 380 | let minusXPoint = currentPoint.x - touchPoint.x 381 | let topConst = self.topConst.constant + minusYPoint 382 | let leftConst = self.leftConst.constant + minusXPoint 383 | let limitYConst = (self.bounds.height - (self.bottomConst.constant + topConst + PKCCropHelper.shared.minSize)) 384 | let limitXConst = (self.bounds.width - (self.rightConst.constant + leftConst + PKCCropHelper.shared.minSize)) 385 | 386 | if topConst >= 0 && minusYPoint > 0 && limitYConst > 0{ 387 | self.topConst.constant = topConst 388 | }else if topConst >= 0 && minusYPoint <= 0 && self.limitTopConst.constant <= topConst{ 389 | self.topConst.constant = topConst 390 | } 391 | 392 | if leftConst >= 0 && minusXPoint > 0 && limitXConst > 0{ 393 | self.leftConst.constant = leftConst 394 | }else if leftConst >= 0 && minusXPoint <= 0 && self.limitLeftConst.constant <= leftConst{ 395 | self.leftConst.constant = leftConst 396 | } 397 | 398 | self.touchPoint = currentPoint 399 | self.makeMask() 400 | } 401 | } 402 | 403 | @IBAction private func rightTopDragAction(_ sender: UIButton, forEvent event: UIEvent) { 404 | guard let touchPoint = self.touchPoint else { 405 | return 406 | } 407 | if let touch = event.touches(for: sender)?.first { 408 | let currentPoint = touch.previousLocation(in: self) 409 | 410 | let minusYPoint = currentPoint.y - touchPoint.y 411 | let minusXPoint = currentPoint.x - touchPoint.x 412 | let rightConst = self.rightConst.constant - minusXPoint 413 | let topConst = self.topConst.constant + minusYPoint 414 | let limitYConst = (self.bounds.height - (self.bottomConst.constant + topConst + PKCCropHelper.shared.minSize)) 415 | let limitXConst = (self.bounds.width - (self.leftConst.constant + rightConst + PKCCropHelper.shared.minSize)) 416 | 417 | if topConst >= 0 && minusYPoint > 0 && limitYConst > 0{ 418 | self.topConst.constant = topConst 419 | }else if topConst >= 0 && minusYPoint <= 0 && self.limitTopConst.constant <= topConst{ 420 | self.topConst.constant = topConst 421 | } 422 | 423 | if rightConst >= 0 && minusXPoint < 0 && limitXConst > 0{ 424 | self.rightConst.constant = rightConst 425 | }else if rightConst >= 0 && minusXPoint >= 0 && self.limitRightConst.constant <= rightConst{ 426 | self.rightConst.constant = rightConst 427 | } 428 | 429 | self.touchPoint = currentPoint 430 | self.makeMask() 431 | } 432 | } 433 | 434 | @IBAction private func leftBottomDragAction(_ sender: UIButton, forEvent event: UIEvent) { 435 | guard let touchPoint = self.touchPoint else { 436 | return 437 | } 438 | if let touch = event.touches(for: sender)?.first { 439 | let currentPoint = touch.previousLocation(in: self) 440 | 441 | let minusYPoint = currentPoint.y - touchPoint.y 442 | let minusXPoint = currentPoint.x - touchPoint.x 443 | let leftConst = self.leftConst.constant + minusXPoint 444 | let bottomConst = self.bottomConst.constant - minusYPoint 445 | let limitYConst = (self.bounds.height - (self.topConst.constant + bottomConst + PKCCropHelper.shared.minSize)) 446 | let limitXConst = (self.bounds.width - (self.rightConst.constant + leftConst + PKCCropHelper.shared.minSize)) 447 | 448 | if bottomConst >= 0 && minusYPoint < 0 && limitYConst > 0{ 449 | self.bottomConst.constant = bottomConst 450 | }else if bottomConst >= 0 && minusYPoint >= 0 && self.limitBottomConst.constant <= bottomConst{ 451 | self.bottomConst.constant = bottomConst 452 | } 453 | 454 | if leftConst >= 0 && minusXPoint > 0 && limitXConst > 0{ 455 | self.leftConst.constant = leftConst 456 | }else if leftConst >= 0 && minusXPoint <= 0 && self.limitLeftConst.constant <= leftConst{ 457 | self.leftConst.constant = leftConst 458 | } 459 | 460 | self.touchPoint = currentPoint 461 | self.makeMask() 462 | } 463 | } 464 | 465 | @IBAction private func rightBottomDragAction(_ sender: UIButton, forEvent event: UIEvent) { 466 | guard let touchPoint = self.touchPoint else { 467 | return 468 | } 469 | if let touch = event.touches(for: sender)?.first { 470 | let currentPoint = touch.previousLocation(in: self) 471 | 472 | let minusYPoint = currentPoint.y - touchPoint.y 473 | let minusXPoint = currentPoint.x - touchPoint.x 474 | let rightConst = self.rightConst.constant - minusXPoint 475 | let bottomConst = self.bottomConst.constant - minusYPoint 476 | let limitYConst = (self.bounds.height - (self.topConst.constant + bottomConst + PKCCropHelper.shared.minSize)) 477 | let limitXConst = (self.bounds.width - (self.leftConst.constant + rightConst + PKCCropHelper.shared.minSize)) 478 | 479 | if bottomConst >= 0 && minusYPoint < 0 && limitYConst > 0{ 480 | self.bottomConst.constant = bottomConst 481 | }else if bottomConst >= 0 && minusYPoint >= 0 && self.limitBottomConst.constant <= bottomConst{ 482 | self.bottomConst.constant = bottomConst 483 | } 484 | 485 | if rightConst >= 0 && minusXPoint < 0 && limitXConst > 0{ 486 | self.rightConst.constant = rightConst 487 | }else if rightConst >= 0 && minusXPoint >= 0 && self.limitRightConst.constant <= rightConst{ 488 | self.rightConst.constant = rightConst 489 | } 490 | 491 | self.touchPoint = currentPoint 492 | self.makeMask() 493 | } 494 | } 495 | 496 | } 497 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCropLineView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 215 | 227 | 239 | 251 | 263 | 274 | 285 | 296 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCropViewController.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | import UIKit 22 | 23 | public protocol PKCCropDelegate: class { 24 | func pkcCropCancel(_ viewController: PKCCropViewController) 25 | func pkcCropImage(_ image: UIImage?, originalImage: UIImage?) 26 | func pkcCropComplete(_ viewController: PKCCropViewController) 27 | } 28 | 29 | 30 | public class PKCCropViewController: UIViewController { 31 | public weak var delegate: PKCCropDelegate? 32 | public var tag: Int = 0 33 | var image = UIImage() 34 | @IBOutlet fileprivate weak var scrollView: UIScrollView! 35 | @IBOutlet fileprivate weak var scrollTopConst: NSLayoutConstraint! 36 | @IBOutlet fileprivate weak var scrollBottomConst: NSLayoutConstraint! 37 | @IBOutlet fileprivate weak var scrollLeadingConst: NSLayoutConstraint! 38 | @IBOutlet fileprivate weak var scrollTrailingConst: NSLayoutConstraint! 39 | @IBOutlet private weak var toolBar: UIToolbar! 40 | 41 | fileprivate var isZoomTimer = Timer() 42 | 43 | fileprivate let imageView = UIImageView() 44 | 45 | @IBOutlet fileprivate weak var cropLineView: PKCCropLineView! 46 | @IBOutlet fileprivate weak var maskView: UIView! 47 | 48 | private var imageRotateRate: Float = 0 49 | 50 | public init(_ image: UIImage, tag: Int = 0) { 51 | super.init(nibName: "PKCCropViewController", bundle: Bundle(for: PKCCrop.self)) 52 | self.image = image 53 | self.tag = tag 54 | } 55 | 56 | 57 | 58 | override public var prefersStatusBarHidden: Bool{ 59 | if self.navigationController == nil || !PKCCropHelper.shared.isNavigationBarShow{ 60 | return true 61 | }else{ 62 | return false 63 | } 64 | } 65 | 66 | 67 | override public func viewWillAppear(_ animated: Bool) { 68 | super.viewWillAppear(animated) 69 | if self.navigationController == nil || !PKCCropHelper.shared.isNavigationBarShow{ 70 | self.navigationController?.setNavigationBarHidden(true, animated: true) 71 | } 72 | } 73 | 74 | 75 | 76 | override public func viewWillDisappear(_ animated: Bool) { 77 | super.viewWillDisappear(animated) 78 | if self.navigationController == nil || !PKCCropHelper.shared.isNavigationBarShow{ 79 | self.navigationController?.setNavigationBarHidden(false, animated: true) 80 | } 81 | } 82 | 83 | 84 | 85 | deinit { 86 | //print("deinit \(self)") 87 | } 88 | 89 | required public init?(coder aDecoder: NSCoder) { 90 | fatalError("init(coder:) has not been implemented") 91 | } 92 | 93 | override public func viewDidLoad() { 94 | super.viewDidLoad() 95 | self.initVars() 96 | self.initCrop(self.image) 97 | } 98 | 99 | private func initVars(){ 100 | self.view.backgroundColor = .black 101 | self.maskView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: PKCCropHelper.shared.maskAlpha) 102 | self.maskView.isUserInteractionEnabled = false 103 | 104 | if let height = self.navigationController?.navigationBar.bounds.height{ 105 | if PKCCropHelper.shared.isNavigationBarShow{ 106 | self.scrollTopConst.constant = 42 + height 107 | } 108 | } 109 | 110 | self.cropLineView.delegate = self 111 | 112 | self.scrollView.delegate = self 113 | self.scrollView.showsVerticalScrollIndicator = false 114 | self.scrollView.showsHorizontalScrollIndicator = false 115 | 116 | self.toolBar.barTintColor = PKCCropHelper.shared.barTintColor 117 | self.toolBar.backgroundColor = .white 118 | self.toolBar.items?.forEach({ (item) in 119 | item.tintColor = PKCCropHelper.shared.tintColor 120 | }) 121 | 122 | var barButtonItems = [UIBarButtonItem]() 123 | 124 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(self.cancelAction(_:)))) 125 | if !PKCCropHelper.shared.isDegressShow{ 126 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil)) 127 | }else{ 128 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil)) 129 | 130 | if let image = PKCCropHelper.shared.degressBeforeImage{ 131 | barButtonItems.append(UIBarButtonItem(image: image.resize(CGSize(width: 24, height: 24)), style: .done, target: self, action: #selector(self.rotateLeftAction(_:)))) 132 | }else{ 133 | barButtonItems.append(UIBarButtonItem(title: "-90 Degress", style: .done, target: self, action: #selector(self.rotateLeftAction(_:)))) 134 | } 135 | 136 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil)) 137 | 138 | if let image = PKCCropHelper.shared.degressAfterImage{ 139 | barButtonItems.append(UIBarButtonItem(image: image.resize(CGSize(width: 24, height: 24)), style: .done, target: self, action: #selector(self.rotateRightAction(_:)))) 140 | }else{ 141 | barButtonItems.append(UIBarButtonItem(title: "90 Degress", style: .done, target: self, action: #selector(self.rotateRightAction(_:)))) 142 | } 143 | 144 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil)) 145 | } 146 | barButtonItems.append(UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(self.doneAction(_:)))) 147 | self.toolBar.setItems(barButtonItems, animated: true) 148 | } 149 | 150 | 151 | private func initCrop(_ image: UIImage){ 152 | self.scrollView.alpha = 0 153 | self.cropLineView.alpha = 0 154 | 155 | self.scrollView.minimumZoomScale = 0.5 156 | self.scrollView.maximumZoomScale = 4 157 | self.scrollView.zoomScale = 1 158 | self.scrollView.subviews.forEach({ $0.removeFromSuperview() }) 159 | 160 | self.scrollView.addSubview(self.imageView) 161 | self.imageView.image = image 162 | let width = UIScreen.main.bounds.width - self.scrollLeadingConst.constant - self.scrollTrailingConst.constant 163 | let height = UIScreen.main.bounds.height - self.scrollTopConst.constant - self.scrollBottomConst.constant 164 | self.imageView.frame = CGRect(x: (width - image.size.width)/2, y: (height - image.size.height)/2, width: image.size.width, height: image.size.height) 165 | self.imageView.contentMode = .scaleAspectFill 166 | 167 | DispatchQueue.main.async { 168 | let minimumXScale = PKCCropHelper.shared.minSize / self.image.size.width 169 | let minimumYScale = PKCCropHelper.shared.minSize / self.image.size.height 170 | 171 | let deviceMinSize = UIScreen.main.bounds.width > UIScreen.main.bounds.height ? UIScreen.main.bounds.height : UIScreen.main.bounds.width 172 | let currentXScale = (deviceMinSize-40) / self.image.size.width 173 | let currentYScale = (deviceMinSize-40) / self.image.size.height 174 | 175 | self.scrollView.minimumZoomScale = minimumXScale < minimumYScale ? minimumYScale : minimumXScale 176 | self.scrollView.zoomScale = currentXScale < currentYScale ? currentYScale : currentXScale 177 | 178 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: { 179 | self.cropLineView.initLineFrame() 180 | }) 181 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.3){ 182 | UIView.animate(withDuration: 0.2){ 183 | self.scrollView.alpha = 1 184 | self.cropLineView.alpha = 1 185 | 186 | } 187 | } 188 | } 189 | } 190 | 191 | 192 | 193 | 194 | @objc private func cancelAction(_ sender: UIBarButtonItem) { 195 | self.delegate?.pkcCropCancel(self) 196 | } 197 | 198 | @objc private func doneAction(_ sender: UIBarButtonItem) { 199 | let cropSize = self.cropLineView.cropSize() 200 | let captureRect = CGRect( 201 | x: -cropSize.origin.x+2, 202 | y: -cropSize.origin.y+2, 203 | width: self.scrollView.frame.width, 204 | height: self.scrollView.frame.height 205 | ) 206 | UIGraphicsBeginImageContextWithOptions(cropSize.size, false, 0.0) 207 | self.scrollView.drawHierarchy(in: captureRect, afterScreenUpdates: false) 208 | let image = UIGraphicsGetImageFromCurrentImageContext() 209 | UIGraphicsEndImageContext() 210 | DispatchQueue.main.async { 211 | self.delegate?.pkcCropImage(image, originalImage: self.image) 212 | } 213 | 214 | self.delegate?.pkcCropComplete(self) 215 | } 216 | 217 | 218 | @objc private func rotateLeftAction(_ sender: UIBarButtonItem) { 219 | guard let image = self.imageView.image?.imageRotatedByDegrees(-90, flip: false) else { 220 | return 221 | } 222 | self.initCrop(image) 223 | } 224 | 225 | 226 | @objc private func rotateRightAction(_ sender: UIBarButtonItem) { 227 | guard let image = self.imageView.image?.imageRotatedByDegrees(90, flip: false) else { 228 | return 229 | } 230 | self.initCrop(image) 231 | } 232 | } 233 | 234 | 235 | extension PKCCropViewController: UIScrollViewDelegate{ 236 | @objc fileprivate func scrollDidZoomCenter(){ 237 | let width = UIScreen.main.bounds.width - self.scrollLeadingConst.constant - self.scrollTrailingConst.constant 238 | let height = UIScreen.main.bounds.height - self.scrollTopConst.constant - self.scrollBottomConst.constant 239 | let widthValue = (width - self.imageView.frame.width)/2 240 | let heightValue = (height - self.imageView.frame.height)/2 241 | self.imageView.frame.origin = CGPoint(x: widthValue, y: heightValue) 242 | self.scrollView.contentInset = UIEdgeInsetsMake(heightValue < 0 ? -heightValue : 0, widthValue < 0 ? -widthValue : 0, heightValue < 0 ? heightValue : 0, widthValue < 0 ? widthValue : 0) 243 | self.cropLineView.imageViewSize(self.imageView.frame) 244 | } 245 | 246 | public func viewForZooming(in scrollView: UIScrollView) -> UIView? { 247 | return self.imageView 248 | } 249 | public func scrollViewDidZoom(_ scrollView: UIScrollView) { 250 | self.isZoomTimer.invalidate() 251 | self.isZoomTimer = Timer.scheduledTimer( 252 | timeInterval: 0.3, 253 | target: self, 254 | selector: #selector(self.scrollDidZoomCenter), 255 | userInfo: nil, 256 | repeats: false 257 | ) 258 | } 259 | } 260 | 261 | 262 | extension PKCCropViewController: PKCCropLineDelegate{ 263 | func pkcCropLineMask(_ frame: CGRect){ 264 | var frameValue = frame 265 | frameValue.origin.y += self.scrollTopConst.constant - 2 266 | frameValue.origin.x += self.scrollLeadingConst.constant - 2 267 | let path = UIBezierPath(roundedRect: frameValue, cornerRadius: PKCCropHelper.shared.isCircle ? frame.width/2 : 0) 268 | path.append(UIBezierPath(rect: self.maskView.frame)) 269 | let maskLayer = CAShapeLayer() 270 | maskLayer.fillRule = kCAFillRuleEvenOdd 271 | maskLayer.backgroundColor = UIColor.clear.cgColor 272 | maskLayer.path = path.cgPath 273 | self.maskView.layer.mask = maskLayer 274 | self.view.layoutIfNeeded() 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /PKCCrop/Classes/PKCCropViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /PKCCrop/Classes/UIImageView+.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | import UIKit 22 | 23 | extension UIImage{ 24 | func imageRotatedByDegrees(_ degrees: CGFloat, flip: Bool) -> UIImage? { 25 | let degreesToRadians: (CGFloat) -> CGFloat = { 26 | return $0 / 180.0 * CGFloat(Double.pi) 27 | } 28 | let rotatedViewBox = UIView(frame: CGRect(origin: CGPoint.zero, size: size)) 29 | rotatedViewBox.backgroundColor = .white 30 | let t = CGAffineTransform(rotationAngle: degreesToRadians(degrees)) 31 | rotatedViewBox.transform = t 32 | let rotatedSize = rotatedViewBox.frame.size 33 | UIGraphicsBeginImageContext(rotatedSize) 34 | let bitmap = UIGraphicsGetCurrentContext() 35 | bitmap?.translateBy(x: rotatedSize.width / 2.0, y: rotatedSize.height / 2.0) 36 | bitmap?.rotate(by: degreesToRadians(degrees)) 37 | let yFlip = flip ? CGFloat(-1.0) : CGFloat(1.0) 38 | bitmap?.scaleBy(x: yFlip, y: -1.0) 39 | guard let cgImg = self.cgImage else{ 40 | return nil 41 | } 42 | bitmap?.draw(cgImg, in: CGRect(x: -size.width / 2, y: -size.height / 2, width: size.width, height: size.height)) 43 | let newImage = UIGraphicsGetImageFromCurrentImageContext() 44 | UIGraphicsEndImageContext() 45 | return newImage 46 | } 47 | 48 | func resize(_ size: CGSize) -> UIImage?{ 49 | let hasAlpha = true 50 | let scale: CGFloat = 0.0 51 | UIGraphicsBeginImageContextWithOptions(size, !hasAlpha, scale) 52 | self.draw(in: CGRect(origin: CGPoint.zero, size: size)) 53 | let scaledImage = UIGraphicsGetImageFromCurrentImageContext() 54 | return scaledImage 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /PKCCrop/Classes/UIView+.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2017 pikachu987 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | 22 | import UIKit 23 | 24 | extension UIView { 25 | func addFullConstraints(_ superView: UIView, top: CGFloat = 0, bottom: CGFloat = 0, left: CGFloat = 0, right: CGFloat = 0){ 26 | self.translatesAutoresizingMaskIntoConstraints = false 27 | superView.addSubview(self) 28 | let view_constraint_H = NSLayoutConstraint.constraints(withVisualFormat: "H:|-\(left)-[view]-\(right)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["view": self]) 29 | let view_constraint_V = NSLayoutConstraint.constraints(withVisualFormat: "V:|-\(top)-[view]-\(bottom)-|", options: NSLayoutFormatOptions.alignAllLeading, metrics: nil, views: ["view": self]) 30 | superView.addConstraints(view_constraint_H) 31 | superView.addConstraints(view_constraint_V) 32 | } 33 | 34 | func horizontalLayout(left: CGFloat = 0, right: CGFloat = 0) -> [NSLayoutConstraint]{ 35 | return NSLayoutConstraint.constraints(withVisualFormat: "H:|-\(left)-[view]-\(right)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["view": self]) 36 | } 37 | func verticalLayout(top: CGFloat = 0, bottom: CGFloat = 0) -> [NSLayoutConstraint]{ 38 | return NSLayoutConstraint.constraints(withVisualFormat: "V:|-\(top)-[view]-\(bottom)-|", options: NSLayoutFormatOptions.alignAllLeading, metrics: nil, views: ["view": self]) 39 | } 40 | 41 | 42 | func widthConst(_ size: CGFloat){ 43 | self.addConstraint(NSLayoutConstraint(item: self, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .width, multiplier: 1, constant: size)) 44 | } 45 | func heightConst(_ size: CGFloat){ 46 | self.addConstraint(NSLayoutConstraint(item: self, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .height, multiplier: 1, constant: size)) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PKCCrop 2 | 3 | 4 | 5 | [![Version](https://img.shields.io/cocoapods/v/PKCCrop.svg?style=flat)](http://cocoapods.org/pods/PKCCrop) 6 | [![License](https://img.shields.io/cocoapods/l/PKCCrop.svg?style=flat)](http://cocoapods.org/pods/PKCCrop) 7 | [![Platform](https://img.shields.io/cocoapods/p/PKCCrop.svg?style=flat)](http://cocoapods.org/pods/PKCCrop) 8 | 9 | ## example Image 10 | 11 | 12 | 13 | 14 | ![image](./image1.png) 15 | ![image](./image2.png) 16 | ![image](./image3.png) 17 | 18 | ![image](./pkc_crop_rotate_left.png) 19 | ![image](./pkc_crop_rotate_right.png) 20 | 21 | [https://icons8.com/](https://icons8.com/) 22 | 23 | ## Example 24 | 25 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 26 | 27 |

28 | 29 | ### - ViewController 30 | ~~~~ 31 | 32 | PKCCropHelper.shared.degressBeforeImage = UIImage(named: "pkc_crop_rotate_left.png") 33 | PKCCropHelper.shared.degressAfterImage = UIImage(named: "pkc_crop_rotate_right.png") 34 | PKCCropHelper.shared.isNavigationBarShow = false 35 | let cropVC = PKCCrop().cropViewController(UIImage(named: "image.jpeg")!) 36 | cropVC.delegate = self 37 | self.present(cropVC, animated: true, completion: nil) 38 | 39 | ~~~~ 40 | 41 |
42 | 43 | ### - PKCCrop Delegate 44 | 45 | 46 | ~~~~ 47 | 48 | extension ViewController: PKCCropDelegate{ 49 | 50 | //return Crop Image & Original Image 51 | func pkcCropImage(_ image: UIImage?, originalImage: UIImage?) { 52 | 53 | } 54 | 55 | //If crop is canceled 56 | func pkcCropCancel(_ viewController: PKCCropViewController) { 57 | viewController.navigationController?.popViewController(animated: true) 58 | } 59 | 60 | //Successful crop 61 | func pkcCropComplete(_ viewController: PKCCropViewController) { 62 | if viewController.tag == 0{ 63 | viewController.navigationController?.popViewController(animated: true) 64 | }else{ 65 | viewController.dismiss(animated: true, completion: nil) 66 | } 67 | } 68 | 69 | } 70 | 71 | ~~~~ 72 | 73 | 74 |

75 | 76 | 77 | 78 | ## Installation 79 | 80 | PKCCrop is available through [CocoaPods](http://cocoapods.org). To install 81 | it, simply add the following line to your Podfile: 82 | 83 | ```ruby 84 | pod "PKCCrop" 85 | ``` 86 | 87 | ## Author 88 | 89 | pikachu987, pikachu987@naver.com 90 | 91 | ## License 92 | 93 | PKCCrop is available under the MIT license. See the LICENSE file for more info. 94 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/image1.png -------------------------------------------------------------------------------- /image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/image2.png -------------------------------------------------------------------------------- /image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/image3.png -------------------------------------------------------------------------------- /img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/img.gif -------------------------------------------------------------------------------- /pkc_crop_rotate_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/pkc_crop_rotate_left.png -------------------------------------------------------------------------------- /pkc_crop_rotate_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pikachu987/PKCCrop/27a6cb426c94bd7ba147a28035a33c19a1389edf/pkc_crop_rotate_right.png --------------------------------------------------------------------------------