diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..dc784c0 Binary files /dev/null and b/.DS_Store differ diff --git a/Example/.DS_Store b/Example/.DS_Store new file mode 100644 index 0000000..4e34c7a Binary files /dev/null and b/Example/.DS_Store differ diff --git a/Example/Athlee-ImageEditorKit/.DS_Store b/Example/Athlee-ImageEditorKit/.DS_Store new file mode 100644 index 0000000..e069042 Binary files /dev/null and b/Example/Athlee-ImageEditorKit/.DS_Store differ diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit.xcodeproj/project.pbxproj b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit.xcodeproj/project.pbxproj index eeb28ef..14454d5 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit.xcodeproj/project.pbxproj +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit.xcodeproj/project.pbxproj @@ -46,7 +46,6 @@ 046417921D3D50F300C9AE3F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 046417901D3D50F300C9AE3F /* Main.storyboard */; }; 046417941D3D50F300C9AE3F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 046417931D3D50F300C9AE3F /* Assets.xcassets */; }; 046417971D3D50F300C9AE3F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 046417951D3D50F300C9AE3F /* LaunchScreen.storyboard */; }; - 046417A21D3D50F400C9AE3F /* Athlee_ImageEditorKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046417A11D3D50F400C9AE3F /* Athlee_ImageEditorKitTests.swift */; }; 046417AF1D3D53D500C9AE3F /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046417AE1D3D53D500C9AE3F /* ImageViewController.swift */; }; 046417B11D3D53EB00C9AE3F /* ContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046417B01D3D53EB00C9AE3F /* ContainerViewController.swift */; }; 046417B31D3D540200C9AE3F /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 046417B21D3D540200C9AE3F /* FilterViewController.swift */; }; @@ -110,7 +109,6 @@ 046417961D3D50F300C9AE3F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 046417981D3D50F300C9AE3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0464179D1D3D50F400C9AE3F /* Athlee-ImageEditorKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Athlee-ImageEditorKitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 046417A11D3D50F400C9AE3F /* Athlee_ImageEditorKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Athlee_ImageEditorKitTests.swift; sourceTree = ""; }; 046417A31D3D50F400C9AE3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 046417AE1D3D53D500C9AE3F /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = ""; }; 046417B01D3D53EB00C9AE3F /* ContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerViewController.swift; sourceTree = ""; }; @@ -321,7 +319,6 @@ 046417A01D3D50F400C9AE3F /* Athlee-ImageEditorKitTests */ = { isa = PBXGroup; children = ( - 046417A11D3D50F400C9AE3F /* Athlee_ImageEditorKitTests.swift */, 046417A31D3D50F400C9AE3F /* Info.plist */, ); path = "Athlee-ImageEditorKitTests"; @@ -433,9 +430,12 @@ TargetAttributes = { 046417881D3D50F300C9AE3F = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = RG4N372RZE; + LastSwiftMigration = 0810; }; 0464179C1D3D50F400C9AE3F = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0810; TestTargetID = 046417881D3D50F300C9AE3F; }; }; @@ -507,7 +507,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_ROOT}/../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"; showEnvVarsInLog = 0; }; 9703A31870DB4752FA3EBC66 /* [CP] Copy Pods Resources */ = { @@ -582,7 +582,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 046417A21D3D50F400C9AE3F /* Athlee_ImageEditorKitTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -704,10 +703,12 @@ baseConfigurationReference = F6D6F5EEAA6737C7520DFF3B /* Pods-Athlee-ImageEditorKit.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = RG4N372RZE; INFOPLIST_FILE = "Athlee-ImageEditorKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.athlee.Athlee-ImageEditorKit"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -717,10 +718,12 @@ baseConfigurationReference = 23388D0110DDFB6BDDAA317F /* Pods-Athlee-ImageEditorKit.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = RG4N372RZE; INFOPLIST_FILE = "Athlee-ImageEditorKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.athlee.Athlee-ImageEditorKit"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -733,6 +736,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.athlee.Athlee-ImageEditorKitTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Athlee-ImageEditorKit.app/Athlee-ImageEditorKit"; }; name = Debug; @@ -745,6 +749,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.athlee.Athlee-ImageEditorKitTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Athlee-ImageEditorKit.app/Athlee-ImageEditorKit"; }; name = Release; diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/.DS_Store b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/.DS_Store new file mode 100644 index 0000000..ab3d08e Binary files /dev/null and b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/.DS_Store differ diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/AppDelegate.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/AppDelegate.swift index f6fbe27..7c05e34 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/AppDelegate.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { return true } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/BrightnessViewController.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/BrightnessViewController.swift index 6765355..9213600 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/BrightnessViewController.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/BrightnessViewController.swift @@ -12,13 +12,13 @@ final class BrightnessViewController: UIViewController { @IBOutlet weak var twoSideSlider: TwoSideSlider! - var parent: ContainerViewController! + var _parent: ContainerViewController! override func viewDidLoad() { super.viewDidLoad() } - @IBAction func didUpdateValue(sender: TwoSideSlider) { + @IBAction func didUpdateValue(_ sender: TwoSideSlider) { let value = Float(sender.currentValue) * 0.001 ContainerViewController.Children.image.brightnessValue = value } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ContainerViewController.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ContainerViewController.swift index ac4cbb3..632a34f 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ContainerViewController.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ContainerViewController.swift @@ -11,9 +11,9 @@ import UIKit final class ContainerViewController: UIViewController { enum State { - case Filters - case Brightness - case Crop + case filters + case brightness + case crop } // MARK: Outlets @@ -35,7 +35,7 @@ final class ContainerViewController: UIViewController { static var crop: CropViewController! } - var state: State = .Filters { didSet { updateVisibility() } } + var state: State = .filters { didSet { updateVisibility() } } // MARK: Life cycle @@ -46,22 +46,22 @@ final class ContainerViewController: UIViewController { updateVisibility() } - override func prefersStatusBarHidden() -> Bool { + override var prefersStatusBarHidden : Bool { return true } // MARK: Actions - @IBAction func didPressFilterButton(sender: AnyObject) { - state = .Filters + @IBAction func didPressFilterButton(_ sender: AnyObject) { + state = .filters } - @IBAction func didPressBrightnessButton(sender: AnyObject) { - state = .Brightness + @IBAction func didPressBrightnessButton(_ sender: AnyObject) { + state = .brightness } - @IBAction func didPressCropButton(sender: AnyObject) { - state = .Crop + @IBAction func didPressCropButton(_ sender: AnyObject) { + state = .crop } // MARK: Utils @@ -77,7 +77,7 @@ final class ContainerViewController: UIViewController { case is BrightnessViewController: Children.brightness = child as! BrightnessViewController - Children.brightness.parent = self + Children.brightness._parent = self case is CropViewController: Children.crop = child as! CropViewController @@ -93,25 +93,25 @@ final class ContainerViewController: UIViewController { brightnessView.alpha = 0 cropView.alpha = 0 - filtersButton.selected = false - brightnessButton.selected = false - cropButton.selected = false + filtersButton.isSelected = false + brightnessButton.isSelected = false + cropButton.isSelected = false switch state { - case .Filters: + case .filters: title = "Select a filter" filtersView.alpha = 1 - filtersButton.selected = true + filtersButton.isSelected = true Children.image.croppingBegan(false) - case .Brightness: + case .brightness: title = "Adjust brightness" brightnessView.alpha = 1 - brightnessButton.selected = true + brightnessButton.isSelected = true Children.image.croppingBegan(false) - case .Crop: + case .crop: title = "Crop the image" cropView.alpha = 1 - cropButton.selected = true + cropButton.isSelected = true Children.image.croppingBegan(true) } } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/CropViewController.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/CropViewController.swift index eeb6173..0bdd2a6 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/CropViewController.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/CropViewController.swift @@ -25,31 +25,31 @@ final class CropViewController: UIViewController { // MARK: Life cycle - override func viewDidAppear(animated: Bool) { + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) scalePicker.reset() } // MARK: IBActions - @IBAction func didPressResetButton(sender: AnyObject) { + @IBAction func didPressResetButton(_ sender: AnyObject) { scalePicker.reset() - transformView.transform = CGAffineTransformIdentity + transformView.transform = CGAffineTransform.identity theta = 0 beta = 0 } - @IBAction func didChangeValue(sender: ScalePicker) { + @IBAction func didChangeValue(_ sender: ScalePicker) { let value = sender.value beta = value let angle = theta + value - let transform = CGAffineTransformMakeRotation(angle.toRadians()) + let transform = CGAffineTransform(rotationAngle: angle.toRadians()) transformView.transform = transform } - @IBAction func didPressRotateButton(sender: AnyObject) { + @IBAction func didPressRotateButton(_ sender: AnyObject) { theta += -90 - let transform = CGAffineTransformMakeRotation((theta + beta).toRadians()) + let transform = CGAffineTransform(rotationAngle: (theta + beta).toRadians()) transformView.transform = transform } } @@ -58,4 +58,4 @@ extension Float { func toRadians() -> CGFloat { return CGFloat(self) * (CGFloat(M_PI) / 180) } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterCell.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterCell.swift index 1074f8c..2f97be9 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterCell.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterCell.swift @@ -12,13 +12,13 @@ final class FilterCell: UICollectionViewCell { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var filterNameLabel: UILabel! - override var selected: Bool { + override var isSelected: Bool { didSet { - if selected { + if isSelected { filterNameLabel.textColor = UIColor(hex: 0x876DF3) filterNameLabel.alpha = 1 } else { - filterNameLabel.textColor = UIColor.grayColor() + filterNameLabel.textColor = UIColor.gray filterNameLabel.alpha = 0.8 } } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterViewController.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterViewController.swift index 80bf274..f3efb71 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterViewController.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/FilterViewController.swift @@ -12,31 +12,31 @@ final class FilterViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! - var parent: ContainerViewController! + var _parent: ContainerViewController! let processor = ImageProcessor() let image = UIImage(named: "photo")! let scale: CGFloat = 3 - let queue = NSOperationQueue() + let queue = OperationQueue() - var images: [NSIndexPath: UIImage] = [:] - var names: [NSIndexPath: String] = [:] + var images: [IndexPath: UIImage] = [:] + var names: [IndexPath: String] = [:] override func viewDidLoad() { super.viewDidLoad() prepareImages() } - override func viewDidAppear(animated: Bool) { + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - let indexPath = NSIndexPath(forItem: 0, inSection: 0) - collectionView.selectItemAtIndexPath(indexPath, animated: false, scrollPosition: .Top) + let indexPath = IndexPath(item: 0, section: 0) + collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .top) } func prepareImages() { for i in 0..<13 { - let indexPath = NSIndexPath(forItem: i, inSection: 0) + let indexPath = IndexPath(item: i, section: 0) if images[indexPath] == nil { let completion: (UIImage?) -> Void = { [indexPath] image in self.images[indexPath] = image @@ -51,25 +51,25 @@ final class FilterViewController: UIViewController { } extension FilterViewController: UICollectionViewDataSource, UICollectionViewDelegate { - func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { + func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } - func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 14 } - func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCellWithReuseIdentifier("FilterCell", forIndexPath: indexPath) as! FilterCell - cell.imageView.opaque = true + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "FilterCell", for: indexPath) as! FilterCell + cell.imageView.isOpaque = true cell.layer.shouldRasterize = true - cell.layer.rasterizationScale = UIScreen.mainScreen().scale + cell.layer.rasterizationScale = UIScreen.main.scale if let image = images[indexPath] { cell.imageView.image = image } else { let completion: (UIImage?) -> Void = { [cell, indexPath] image in - NSOperationQueue.mainQueue().addOperationWithBlock { + OperationQueue.main.addOperation { self.images[indexPath] = image cell.imageView.image = image } @@ -83,18 +83,18 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele return cell } - func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) { - if let cell = cell as? FilterCell, image = images[indexPath] { + func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + if let cell = cell as? FilterCell, let image = images[indexPath] { cell.imageView.image = image cell.filterNameLabel.text = names[indexPath] } } - func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if let image = images[indexPath] { ContainerViewController.Children.image.image = image - guard let cell = collectionView.cellForItemAtIndexPath(indexPath) else { + guard let cell = collectionView.cellForItem(at: indexPath) else { return } @@ -102,7 +102,7 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele } } - func prepareImage(at indexPath: NSIndexPath, completion: (UIImage?) -> Void) { + func prepareImage(at indexPath: IndexPath, completion: (UIImage?) -> Void) { switch indexPath.item { case 0: names[indexPath] = "None" @@ -114,7 +114,7 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele processor.process(image: self.image, filter: filter, completion: completion) case 2: - let filter = ColorMonochromeFilter(image: image, color: .orangeColor()) + let filter = ColorMonochromeFilter(image: image, color: .orange) names[indexPath] = "Monochrome" processor.process(image: self.image, filter: filter, completion: completion) @@ -124,7 +124,7 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele processor.process(image: self.image, filter: filter, completion: completion) case 4: - let filter = FalseColorFilter(image: image, inputColor0: .redColor(), inputColor1: .blueColor()) + let filter = FalseColorFilter(image: image, inputColor0: .red, inputColor1: .blue) names[indexPath] = "False Color" processor.process(image: self.image, filter: filter, completion: completion) @@ -181,19 +181,19 @@ extension FilterViewController: UICollectionViewDataSource, UICollectionViewDele extension FilterViewController: UICollectionViewDelegateFlowLayout { - func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8) } - func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: collectionView.frame.width / 4, height: collectionView.frame.width / 2.5) } - func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return 8 } - func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return 8 } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ImageViewController.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ImageViewController.swift index 9f24ecd..166fe3a 100644 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ImageViewController.swift +++ b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKit/ImageViewController.swift @@ -29,7 +29,7 @@ final class ImageViewController: UIViewController, Cropable { return 0 } - return !navBar.hidden ? navBar.frame.height : 0 + return !navBar.isHidden ? navBar.frame.height : 0 } lazy var delegate: CropableScrollViewDelegate = { @@ -69,10 +69,10 @@ final class ImageViewController: UIViewController, Cropable { image = UIImage(named: "photo")! addImage(image) - view.userInteractionEnabled = false + view.isUserInteractionEnabled = false } - override func viewDidAppear(animated: Bool) { + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) updateContent() highlightArea(false, animated: false) @@ -80,12 +80,12 @@ final class ImageViewController: UIViewController, Cropable { // MARK: Communication - func croppingBegan(began: Bool) { + func croppingBegan(_ began: Bool) { if began { - view.userInteractionEnabled = true + view.isUserInteractionEnabled = true highlightArea(true, animated: true) } else { - view.userInteractionEnabled = false + view.isUserInteractionEnabled = false highlightArea(false, animated: false) } } @@ -101,7 +101,7 @@ final class ImageViewController: UIViewController, Cropable { ) processor.process(image: image, filter: filter) { image in - NSOperationQueue.mainQueue().addOperationWithBlock { + OperationQueue.main.addOperation { guard let image = image else { return } self.addImage(image, adjustingContent: false) } diff --git a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKitTests/Athlee_ImageEditorKitTests.swift b/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKitTests/Athlee_ImageEditorKitTests.swift deleted file mode 100644 index 17d437a..0000000 --- a/Example/Athlee-ImageEditorKit/Athlee-ImageEditorKitTests/Athlee_ImageEditorKitTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// Athlee_ImageEditorKitTests.swift -// Athlee-ImageEditorKitTests -// -// Created by mac on 18/07/16. -// Copyright © 2016 Athlee. All rights reserved. -// - -import XCTest -@testable import Athlee_ImageEditorKit - -class Athlee_ImageEditorKitTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/Example/Athlee-ImageEditorKit/Podfile b/Example/Athlee-ImageEditorKit/Podfile index bebf8d2..74596ec 100644 --- a/Example/Athlee-ImageEditorKit/Podfile +++ b/Example/Athlee-ImageEditorKit/Podfile @@ -1,5 +1,13 @@ target 'Athlee-ImageEditorKit' do platform :ios, '9.0' use_frameworks! - pod 'ImagePickerKit', '~> 0.2.3’ + pod 'ImagePickerKit', '~> 0.2.4’ + + post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['SWIFT_VERSION'] = '3.0' + end + end + end end diff --git a/Example/Athlee-ImageEditorKit/Podfile.lock b/Example/Athlee-ImageEditorKit/Podfile.lock index 68bb776..e70fc7f 100644 --- a/Example/Athlee-ImageEditorKit/Podfile.lock +++ b/Example/Athlee-ImageEditorKit/Podfile.lock @@ -1,12 +1,12 @@ PODS: - - ImagePickerKit (0.2.3) + - ImagePickerKit (0.2.4) DEPENDENCIES: - - ImagePickerKit (~> 0.2.3) + - ImagePickerKit (~> 0.2.4) SPEC CHECKSUMS: - ImagePickerKit: 21dcc7162dff7cf557f1e7f7f4bd6b8716d327af + ImagePickerKit: 157c106e76fe07c7952752b68751661d8da3d188 -PODFILE CHECKSUM: ca864079c1326de0c3b1954af44b67d84175e781 +PODFILE CHECKSUM: 1f15b63c182d4bcdc03d9bcfb417684637e91d9a -COCOAPODS: 1.0.1 +COCOAPODS: 1.1.1 diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CGRect.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CGRect.swift index aab9028..f68c159 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CGRect.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CGRect.swift @@ -10,12 +10,12 @@ import UIKit internal extension CGRect { enum Difference { - case Added(area: CGRect) - case Removed(area: CGRect) + case added(area: CGRect) + case removed(area: CGRect) } // TODO: Make this function accurate in case of Geometry. - func exclusiveOr(rect: CGRect) -> [CGRect] { + func exclusiveOr(_ rect: CGRect) -> [CGRect] { var res: [CGRect] = [] if rect.maxY > self.maxY { @@ -43,12 +43,12 @@ internal extension CGRect { func difference(with rect: CGRect) -> [Difference] { guard intersects(rect) else { - return [.Added(area: rect), .Removed(area: self)] + return [.added(area: rect), .removed(area: self)] } - let added = exclusiveOr(rect).map { Difference.Added(area: $0) } - let removed = rect.exclusiveOr(self).map { Difference.Removed(area: $0) } + let added = exclusiveOr(rect).map { Difference.added(area: $0) } + let removed = rect.exclusiveOr(self).map { Difference.removed(area: $0) } return added + removed } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Capturable.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Capturable.swift index 0976f7c..e91c712 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Capturable.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Capturable.swift @@ -67,7 +67,7 @@ public protocol Capturable: class { /// /// - parameter view: A holder of the preview. /// - func reloadPreview(view: UIView) + func reloadPreview(_ view: UIView) /// /// Registers an observer for notifications (when the device @@ -90,7 +90,7 @@ public protocol Capturable: class { /// /// - parameter mode: A capture flash mode. /// - func setFlashMode(mode: AVCaptureFlashMode) + func setFlashMode(_ mode: AVCaptureFlashMode) /// /// Provides camera focusing at the certain area aroung the point provided. @@ -114,7 +114,7 @@ public extension Capturable { } for device in AVCaptureDevice.devices() { - if let device = device as? AVCaptureDevice where device.position == AVCaptureDevicePosition.Back { + if let device = device as? AVCaptureDevice, device.position == AVCaptureDevicePosition.back { self.device = device } } @@ -134,7 +134,7 @@ public extension Capturable { assertionFailure("Unable to connect to the device input....") } - setFlashMode(.Auto) + setFlashMode(.auto) startCamera() registerForNotifications() } @@ -143,11 +143,11 @@ public extension Capturable { /// Starts capturing from a device camera. /// func startCamera() { - let status = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) + let status = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) - if status == AVAuthorizationStatus.Authorized { + if status == AVAuthorizationStatus.authorized { session?.startRunning() - } else if status == AVAuthorizationStatus.Denied || status == AVAuthorizationStatus.Restricted { + } else if status == AVAuthorizationStatus.denied || status == AVAuthorizationStatus.restricted { session?.stopRunning() } } @@ -166,11 +166,11 @@ public extension Capturable { /// func addPreviewLayer(at view: UIView) { let videoLayer = AVCaptureVideoPreviewLayer(session: session) - videoLayer.frame = view.bounds - videoLayer.videoGravity = AVLayerVideoGravityResizeAspectFill + videoLayer?.frame = view.bounds + videoLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill - dispatch_async(dispatch_get_main_queue()) { - view.layer.addSublayer(videoLayer) + DispatchQueue.main.async { + view.layer.addSublayer(videoLayer!) } } @@ -179,7 +179,7 @@ public extension Capturable { /// /// - parameter view: A holder of the preview. /// - func reloadPreview(view: UIView) { + func reloadPreview(_ view: UIView) { view.layer.sublayers?.forEach { if $0 is AVCaptureVideoPreviewLayer { $0.frame = self.previewViewContainer.bounds @@ -221,10 +221,10 @@ public extension Capturable { session.removeInput(input as! AVCaptureInput) } - let position = (videoInput?.device.position == AVCaptureDevicePosition.Front) ? AVCaptureDevicePosition.Back : AVCaptureDevicePosition.Front + let position = (videoInput?.device.position == AVCaptureDevicePosition.front) ? AVCaptureDevicePosition.back : AVCaptureDevicePosition.front - for device in AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) { - if let device = device as? AVCaptureDevice where device.position == position { + for device in AVCaptureDevice.devices(withMediaType: AVMediaTypeVideo) { + if let device = device as? AVCaptureDevice, device.position == position { videoInput = try AVCaptureDeviceInput(device: device) session.addInput(videoInput) } @@ -244,7 +244,7 @@ public extension Capturable { /// /// - parameter mode: A capture flash mode. /// - func setFlashMode(mode: AVCaptureFlashMode) { + func setFlashMode(_ mode: AVCaptureFlashMode) { guard cameraIsAvailable() else { return } do { @@ -256,7 +256,7 @@ public extension Capturable { } } catch { assertionFailure("Unable to lock device for configuration. Error: \(error)") - device?.flashMode = .Off + device?.flashMode = .off return } } @@ -283,48 +283,48 @@ public extension Capturable { y: 1.0 - point.x / viewsize.width ) - let device = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) + let device = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo) do { - try device.lockForConfiguration() + try device?.lockForConfiguration() } catch { assertionFailure("Unable to lock device for configuration. Error: \(error)") return } - if device.isFocusModeSupported(AVCaptureFocusMode.AutoFocus) == true { - device.focusMode = AVCaptureFocusMode.AutoFocus - device.focusPointOfInterest = newPoint + if device?.isFocusModeSupported(AVCaptureFocusMode.autoFocus) == true { + device?.focusMode = AVCaptureFocusMode.autoFocus + device?.focusPointOfInterest = newPoint } - if device.isExposureModeSupported(AVCaptureExposureMode.ContinuousAutoExposure) == true { - device.exposureMode = AVCaptureExposureMode.ContinuousAutoExposure - device.exposurePointOfInterest = newPoint + if device?.isExposureModeSupported(AVCaptureExposureMode.continuousAutoExposure) == true { + device?.exposureMode = AVCaptureExposureMode.continuousAutoExposure + device?.exposurePointOfInterest = newPoint } - device.unlockForConfiguration() + device?.unlockForConfiguration() focusView?.alpha = 0.0 focusView?.center = point - focusView?.backgroundColor = UIColor.clearColor() - focusView?.layer.borderColor = UIColor.orangeColor().CGColor + focusView?.backgroundColor = UIColor.clear + focusView?.layer.borderColor = UIColor.orange.cgColor focusView?.layer.borderWidth = 1.0 - focusView!.transform = CGAffineTransformMakeScale(1.0, 1.0) + focusView!.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) - UIView.animateWithDuration( - 0.8, + UIView.animate( + withDuration: 0.8, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 3.0, - options: UIViewAnimationOptions.CurveEaseIn, + options: UIViewAnimationOptions.curveEaseIn, animations: { self.focusView!.alpha = 1.0 - self.focusView!.transform = CGAffineTransformMakeScale(0.7, 0.7) + self.focusView!.transform = CGAffineTransform(scaleX: 0.7, y: 0.7) }, completion: { _ in - self.focusView!.transform = CGAffineTransformMakeScale(1.0, 1.0) + self.focusView!.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) self.focusView!.alpha = 0 } ) @@ -339,9 +339,9 @@ internal extension Capturable { /// Returns `true` if a user has given access to the camera. /// func cameraIsAvailable() -> Bool { - let status = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) + let status = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) - if status == AVAuthorizationStatus.Authorized { + if status == AVAuthorizationStatus.authorized { return true } @@ -353,12 +353,12 @@ internal extension Capturable { /// /// - parameter notification: A foregound entry notification. /// - func willEnterForegroundNotification(notification: NSNotification) { - let status = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) + func willEnterForegroundNotification(_ notification: Notification) { + let status = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) - if status == AVAuthorizationStatus.Authorized { + if status == AVAuthorizationStatus.authorized { session?.startRunning() - } else if status == AVAuthorizationStatus.Denied || status == AVAuthorizationStatus.Restricted { + } else if status == AVAuthorizationStatus.denied || status == AVAuthorizationStatus.restricted { session?.stopRunning() } } diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CaptureNotificationObserver.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CaptureNotificationObserver.swift index f9db208..a6e7c33 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CaptureNotificationObserver.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CaptureNotificationObserver.swift @@ -11,27 +11,27 @@ import UIKit /// /// A default observer around capture notifications. /// -public final class CaptureNotificationObserver: NSObject { - private unowned var capturable: T +open class CaptureNotificationObserver: NSObject { + fileprivate unowned var capturable: T public init(capturable: T) { self.capturable = capturable } - public func register() { - let notificationCenter = NSNotificationCenter.defaultCenter() + open func register() { + let notificationCenter = NotificationCenter.default notificationCenter.addObserver( self, selector: #selector(CaptureNotificationObserver.willEnterForegroundNotification(_:)), - name: UIApplicationWillEnterForegroundNotification, object: nil + name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil ) } - public func unregister() { - NSNotificationCenter.defaultCenter().removeObserver(self) + open func unregister() { + NotificationCenter.default.removeObserver(self) } - public func willEnterForegroundNotification(notification: NSNotification) { + open func willEnterForegroundNotification(_ notification: Notification) { capturable.willEnterForegroundNotification(notification) } } diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CollectionViewChangeObserver.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CollectionViewChangeObserver.swift index 1a2765d..da5058e 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CollectionViewChangeObserver.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CollectionViewChangeObserver.swift @@ -13,12 +13,12 @@ import Photos /// A default implementation for `PHPhotoLibraryChangeObserver` /// protocol observer object. /// -public final class CollectionViewChangeObserver: NSObject { - public let collectionView: UICollectionView +open class CollectionViewChangeObserver: NSObject { + open let collectionView: UICollectionView - internal unowned var source: protocol + internal unowned var source: PhotoFetchable & PhotoCachable - public init(collectionView: UICollectionView, source: protocol) { + public init(collectionView: UICollectionView, source: PhotoFetchable & PhotoCachable) { self.collectionView = collectionView self.source = source } @@ -27,13 +27,13 @@ public final class CollectionViewChangeObserver: NSObject { // MARK: - PHPhotoLibraryChangeObserver extension CollectionViewChangeObserver: PHPhotoLibraryChangeObserver { - public func photoLibraryDidChange(changeInstance: PHChange) { - dispatch_async(dispatch_get_main_queue()) { - guard let collectionChanges = changeInstance.changeDetailsForFetchResult(self.source.fetchResult) else { + open func photoLibraryDidChange(_ changeInstance: PHChange) { + DispatchQueue.main.async { + guard let collectionChanges = changeInstance.changeDetails(for: self.source.fetchResult as! PHFetchResult) else { return } - self.source.fetchResult = collectionChanges.fetchResultAfterChanges + self.source.fetchResult = collectionChanges.fetchResultAfterChanges as! PHFetchResult if !collectionChanges.hasIncrementalChanges || collectionChanges.hasMoves { self.collectionView.reloadData() @@ -41,17 +41,17 @@ extension CollectionViewChangeObserver: PHPhotoLibraryChangeObserver { self.collectionView.performBatchUpdates({ let removedIndexes = collectionChanges.removedIndexes if (removedIndexes?.count ?? 0) != 0 { - self.collectionView.deleteItemsAtIndexPaths(removedIndexes!.indexPaths(from: 0)) + self.collectionView.deleteItems(at: removedIndexes!.indexPaths(from: 0)) } let insertedIndexes = collectionChanges.insertedIndexes if (insertedIndexes?.count ?? 0) != 0 { - self.collectionView.insertItemsAtIndexPaths(insertedIndexes!.indexPaths(from: 0)) + self.collectionView.insertItems(at: insertedIndexes!.indexPaths(from: 0)) } let changedIndexes = collectionChanges.changedIndexes if (changedIndexes?.count ?? 0) != 0 { - self.collectionView.reloadItemsAtIndexPaths(changedIndexes!.indexPaths(from: 0)) + self.collectionView.reloadItems(at: changedIndexes!.indexPaths(from: 0)) } }, completion: nil) diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Cropable.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Cropable.swift index d98cb5e..b0e2445 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Cropable.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/Cropable.swift @@ -53,7 +53,10 @@ public protocol Cropable { /// /// Centers a content view in its superview depending on the size. /// - func centerContent() + /// - parameter forcing: Determines whether centering should be done forcing. + /// This, generally, means that the content will be forced to get centered. + /// + func centerContent(forcing: Bool) /// /// This method is called whenever the zooming @@ -92,7 +95,7 @@ public protocol Cropable { /// - parameter highlght: A flag indicating whether it should show or hide the zone. /// - parameter animated: An animation flag, it's `true` by default. /// - func highlightArea(highlight: Bool, animated: Bool) + func highlightArea(_ highlight: Bool, animated: Bool) } // MARK: - Default implementations for UIImageView childs @@ -109,15 +112,15 @@ public extension Cropable where ChildView == UIImageView { view.addSubview(cropView) let anchors = [ - cropView.leadingAnchor.constraintEqualToAnchor(view.leadingAnchor), - cropView.trailingAnchor.constraintEqualToAnchor(view.trailingAnchor), - cropView.topAnchor.constraintEqualToAnchor(view.topAnchor), - cropView.bottomAnchor.constraintEqualToAnchor(view.bottomAnchor) + cropView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + cropView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + cropView.topAnchor.constraint(equalTo: view.topAnchor), + cropView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ].flatMap { $0 } - NSLayoutConstraint.activateConstraints(anchors) + NSLayoutConstraint.activate(anchors) - cropView.backgroundColor = .clearColor() + cropView.backgroundColor = .clear cropView.showsHorizontalScrollIndicator = false cropView.showsVerticalScrollIndicator = false cropView.contentSize = view.bounds.size @@ -143,12 +146,13 @@ public extension Cropable where ChildView == UIImageView { /// - parameter image: An image to use. /// - parameter adjustingContent: Indicates whether the content should be adjusted or not. Default value is `true`. /// - func addImage(image: UIImage, adjustingContent: Bool = true) { + func addImage(_ image: UIImage, adjustingContent: Bool = true) { childView.image = image if adjustingContent { childView.sizeToFit() childView.frame.origin = .zero + cropView.contentOffset = .zero cropView.contentSize = childView.image!.size updateContent() @@ -178,24 +182,26 @@ public extension Cropable { } /// - /// Updated the current cropable content area, zoom and scale. + /// Updates the current cropable content area, zoom and scale. /// func updateContent() { let childViewSize = childView.bounds.size - let scrollViewSize = cropView.superview!.frame + let scrollViewSize = cropView.bounds.size let widthScale = scrollViewSize.width / childViewSize.width let heightScale = scrollViewSize.height / childViewSize.height - let scale = min(heightScale, widthScale) + + let minScale = max(scrollViewSize.width, scrollViewSize.height) / max(childViewSize.width, childViewSize.height) + let maxScale = max(heightScale, widthScale) if let _self = self as? UIScrollViewDelegate { cropView.delegate = _self } - cropView.minimumZoomScale = scale + cropView.minimumZoomScale = minScale cropView.maximumZoomScale = 4 - cropView.zoomScale = scale + cropView.zoomScale = maxScale - centerContent() + centerContent(forcing: true) highlightArea(alwaysShowGuidelines, animated: false) } @@ -203,26 +209,25 @@ public extension Cropable { /// /// Centers a content view in its superview depending on the size. /// - func centerContent() { - let boundsSize = cropView.bounds.size - let contentFrame = childView.frame - var origin = contentFrame.origin + /// - parameter forcing: Determines whether centering should be done forcing. + /// This, generally, means that the content will be forced to get centered. + /// + func centerContent(forcing: Bool = false) { + var (left, top): (CGFloat, CGFloat) = (0, 0) - if contentFrame.size.width < boundsSize.width { - origin.x = (boundsSize.width - contentFrame.width) / 2 - } else { - origin.x = 0 + if cropView.contentSize.width < cropView.bounds.width { + left = (cropView.bounds.width - cropView.contentSize.width) / 2 + } else if forcing { + cropView.contentOffset.x = abs(cropView.bounds.width - cropView.contentSize.width) / 2 } - if contentFrame.size.height < boundsSize.height { - origin.y = (boundsSize.height - contentFrame.height) / 2 - } else { - origin.y = 0 + if cropView.contentSize.height < cropView.bounds.height { + top = (cropView.bounds.height - cropView.contentSize.height) / 2 + } else if forcing { + cropView.contentOffset.y = abs(cropView.bounds.height - cropView.contentSize.height) / 2 } - origin.y -= topOffset - cropView.contentInset.bottom = -topOffset - childView.frame.origin = origin + cropView.contentInset = UIEdgeInsets(top: top, left: left, bottom: top, right: left) } /// @@ -268,22 +273,22 @@ public extension Cropable { /// - parameter highlght: A flag indicating whether it should show or hide the zone. /// - parameter animated: An animation flag, it's `true` by default. /// - func highlightArea(highlight: Bool, animated: Bool = true) { - guard UIApplication.sharedApplication().keyWindow != nil else { + func highlightArea(_ highlight: Bool, animated: Bool = true) { + guard UIApplication.shared.keyWindow != nil else { return } linesView.setNeedsDisplay() if linesView.superview == nil { cropView.insertSubview(linesView, aboveSubview: childView) - linesView.backgroundColor = UIColor.clearColor() + linesView.backgroundColor = UIColor.clear linesView.alpha = 0 } else { if animated { - UIView.animateWithDuration( - 0.3, + UIView.animate( + withDuration: 0.3, delay: 0, - options: [.AllowUserInteraction], + options: [.allowUserInteraction], animations: { self.linesView.alpha = highlight ? 1 : 0 }, @@ -302,8 +307,7 @@ public extension Cropable { ) let visibleRect = CGRect(origin: cropView.contentOffset, size: cropView.bounds.size) - let intersection = visibleRect.intersect(childView.frame) + let intersection = visibleRect.intersection(childView.frame) linesView.frame = intersection } } - diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CropableScrollViewDelegate.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CropableScrollViewDelegate.swift index 800da20..cefaccf 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CropableScrollViewDelegate.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/CropableScrollViewDelegate.swift @@ -11,12 +11,26 @@ import UIKit /// /// A `UIScrollViewDelegate` for `Cropable` objects. /// -public final class CropableScrollViewDelegate: NSObject, UIScrollViewDelegate { - private unowned var cropable: T +open class CropableScrollViewDelegate: NSObject, UIScrollViewDelegate where T: AnyObject { + fileprivate unowned var cropable: T - public let linesView = LinesView() + open let linesView = LinesView() - private var panning = false + /// Indicates whether cropping should or should not be enabled for using. + open var isEnabled = true { + didSet { + if isEnabled { + cropable.cropView.isScrollEnabled = true + } else { + cropable.highlightArea(false, animated: false) + cropable.cropView.isScrollEnabled = false + } + } + } + + fileprivate var isPanning = false + + // MARK: Initialization public init(cropable: T) { self.cropable = cropable @@ -24,33 +38,43 @@ public final class CropableScrollViewDelegate: N // MARK: UIScrollViewDelegate - public func scrollViewWillBeginZooming(scrollView: UIScrollView, withView view: UIView?) { + open func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) { + guard isEnabled else { return } + cropable.willZoom() } - public func scrollViewDidZoom(scrollView: UIScrollView) { + open func scrollViewDidZoom(_ scrollView: UIScrollView) { + guard isEnabled else { return } + cropable.didZoom() } - public func scrollViewDidScroll(scrollView: UIScrollView) { + open func scrollViewDidScroll(_ scrollView: UIScrollView) { + guard isEnabled else { return } + if cropable.alwaysShowGuidelines { cropable.highlightArea(true) } - guard panning else { + guard isPanning else { return } cropable.highlightArea(true) } - public func scrollViewWillBeginDragging(scrollView: UIScrollView) { - panning = true + open func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + guard isEnabled else { return } + + isPanning = true cropable.highlightArea(true) } - public func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { - panning = false + open func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { + guard isEnabled else { return } + + isPanning = false if cropable.alwaysShowGuidelines { cropable.highlightArea(true, animated: false) @@ -59,12 +83,14 @@ public final class CropableScrollViewDelegate: N } } - public func scrollViewDidEndZooming(scrollView: UIScrollView, withView view: UIView?, atScale scale: CGFloat) { + open func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) { + guard isEnabled else { return } + cropable.willEndZooming() cropable.didEndZooming() } - public func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? { + open func viewForZooming(in scrollView: UIScrollView) -> UIView? { return cropable.childView } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/FloatingViewLayout.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/FloatingViewLayout.swift index 94fb31a..e85d753 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/FloatingViewLayout.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/FloatingViewLayout.swift @@ -15,17 +15,17 @@ import UIKit /// - Moved: the floating view is moved. /// public enum State { - case Unfolded - case Folded - case Moved + case unfolded + case folded + case moved var description: String { switch self { - case .Unfolded: + case .unfolded: return "Unfolded" - case .Folded: + case .folded: return "Folded" - case .Moved: + case .moved: return "Moved" } } @@ -37,9 +37,9 @@ public enum State { /// type supports only vertical states for now. /// public enum Direction { - case Up(delta: CGFloat) - case Down(delta: CGFloat) - case None + case up(delta: CGFloat) + case down(delta: CGFloat) + case none /// /// Constructs the same direction type with a new @@ -48,23 +48,23 @@ public enum Direction { /// - parameter delta: The distance passed. /// - returns: The same direction type with a new delta. /// - func changed(delta delta: CGFloat) -> Direction { - if case .Up(_) = self { - return .Up(delta: delta) - } else if case .Down(_) = self { - return .Down(delta: delta) + func changed(delta: CGFloat) -> Direction { + if case .up(_) = self { + return .up(delta: delta) + } else if case .down(_) = self { + return .down(delta: delta) } else { - return .None + return .none } } var description: String { switch self { - case .Up(_): + case .up(_): return "Up" - case .Down(_): + case .down(_): return "Down" - case .None: + case .none: return "None" } } @@ -74,8 +74,8 @@ public enum Direction { /// Options for floating dragging zone. /// public enum DraggingZone { - case All - case Some(CGFloat) + case all + case some(CGFloat) } /// @@ -124,7 +124,7 @@ public protocol FloatingViewLayout: class { /// - parameter view: The view to move. /// - parameter direction: The movement's direction with preset delta. /// - func move(view view: UIView, in direction: Direction) + func move(view: UIView, in direction: Direction) /// /// Receives a pan gesture and provides handle actions. @@ -132,7 +132,7 @@ public protocol FloatingViewLayout: class { /// - parameter recognizer: The sender gesture recognizer of a pan. /// - parameter view: The floating view that should be moved. /// - func receivePanGesture(recognizer recognizer: UIPanGestureRecognizer, with view: UIView) + func receivePanGesture(recognizer: UIPanGestureRecognizer, with view: UIView) /// /// Restores a given floating view to the certain state. @@ -141,7 +141,7 @@ public protocol FloatingViewLayout: class { /// - parameter state: The state to change to. /// - parameter animated: Indicates whether the transition should be animated or not. Default value is `false`. /// - func restore(view view: UIView, to state: State, animated: Bool) + func restore(view: UIView, to state: State, animated: Bool) /// /// Determines whether the floating view is moved enough @@ -150,7 +150,7 @@ public protocol FloatingViewLayout: class { /// - parameter view: The floating view. /// - parameter direction: The movement's direction. /// - func crossedEnough(view view: UIView, in direction: Direction) -> Bool + func crossedEnough(view: UIView, in direction: Direction) -> Bool } // @@ -160,38 +160,38 @@ public protocol FloatingViewLayout: class { internal extension FloatingViewLayout { func direction(withVelocity velocity: CGPoint, delta: CGFloat) -> Direction { if velocity.y < 0 { - return Direction.Up(delta: delta) + return Direction.up(delta: delta) } else if velocity.y > 0 { - return Direction.Down(delta: delta) + return Direction.down(delta: delta) } else { - return Direction.None + return Direction.none } } func closestState(of view: UIView) -> State { if view.frame.midY <= 0 { - return .Folded + return .folded } else { - return .Unfolded + return .unfolded } } func prepareOverlayBlurringViews(with view: UIView) { overlayBlurringView = UIView() - overlayBlurringView.backgroundColor = .blackColor() + overlayBlurringView.backgroundColor = .black overlayBlurringView.translatesAutoresizingMaskIntoConstraints = false overlayBlurringView.alpha = 0 view.addSubview(overlayBlurringView) let anchors = [ - overlayBlurringView.topAnchor.constraintEqualToAnchor(view.topAnchor), - overlayBlurringView.bottomAnchor.constraintEqualToAnchor(view.bottomAnchor), - overlayBlurringView.trailingAnchor.constraintEqualToAnchor(view.trailingAnchor), - overlayBlurringView.leadingAnchor.constraintEqualToAnchor(view.leadingAnchor) + overlayBlurringView.topAnchor.constraint(equalTo: view.topAnchor), + overlayBlurringView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + overlayBlurringView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + overlayBlurringView.leadingAnchor.constraint(equalTo: view.leadingAnchor) ].flatMap { $0 } - NSLayoutConstraint.activateConstraints(anchors) + NSLayoutConstraint.activate(anchors) } } @@ -218,10 +218,10 @@ public extension FloatingViewLayout { /// - parameter state: The state to change to. /// - parameter animated: Indicates whether the transition should be animated or not. Default value is `false`. /// - func restore(view view: UIView, to state: State, animated: Bool = false) { - if state == .Unfolded { + func restore(view: UIView, to state: State, animated: Bool = false) { + if state == .unfolded { topConstraint.constant = 0 - } else if state == .Folded { + } else if state == .folded { topConstraint.constant = -(view.frame.height - visibleArea) } @@ -230,13 +230,13 @@ public extension FloatingViewLayout { prepareOverlayBlurringViews(with: view) } - UIView.animateWithDuration( - 0.25, + UIView.animate( + withDuration: 0.25, delay: 0, - options: [.AllowUserInteraction, .BeginFromCurrentState, .CurveEaseIn], + options: [.allowUserInteraction, .beginFromCurrentState, .curveEaseIn], animations: { view.superview?.layoutIfNeeded() - self.overlayBlurringView.alpha = self.state == .Unfolded ? 0 : 0.6 + self.overlayBlurringView.alpha = self.state == .unfolded ? 0 : 0.6 }, completion: { finished in @@ -253,29 +253,29 @@ public extension FloatingViewLayout { /// - parameter view: The view to move. /// - parameter direction: The movement's direction with preset delta. /// - func move(view view: UIView, in direction: Direction) { + func move(view: UIView, in direction: Direction) { switch direction { - case .Up(var delta): + case .up(var delta): let maxY = (topConstraint.constant + view.frame.height) if maxY + delta < visibleArea { - guard state == .Moved else { return } + guard state == .moved else { return } delta += visibleArea - (delta + maxY) } prepareForMovement() topConstraint.constant += delta - case .Down(var delta): + case .down(var delta): let minY = topConstraint.constant if minY + delta > 0 { - guard state == .Moved else { return } + guard state == .moved else { return } delta -= minY + delta } prepareForMovement() topConstraint.constant += delta - case .None: + case .none: print("Direction is not found yet!") } @@ -298,10 +298,10 @@ public extension FloatingViewLayout { /// - parameter view: The floating view. /// - parameter direction: The movement's direction. /// - func crossedEnough(view view: UIView, in direction: Direction) -> Bool { - if case .Down(_) = direction { + func crossedEnough(view: UIView, in direction: Direction) -> Bool { + if case .down(_) = direction { return view.frame.midY >= 0 - } else if case .Up(_) = direction { + } else if case .up(_) = direction { return view.frame.midY <= 0 } else { return false @@ -314,22 +314,22 @@ public extension FloatingViewLayout { /// - parameter recognizer: The sender gesture recognizer of a pan. /// - parameter view: The floating view that should be moved. /// - func receivePanGesture(recognizer recognizer: UIPanGestureRecognizer, with view: UIView) { + func receivePanGesture(recognizer: UIPanGestureRecognizer, with view: UIView) { guard let superview = recognizer.view else { assertionFailure("Unable to find a registered view for UIPangestureRecognizer: \(recognizer).") return } - let location = recognizer.locationInView(superview) - let velocity = recognizer.velocityInView(superview) + let location = recognizer.location(in: superview) + let velocity = recognizer.velocity(in: superview) - if case .Some(let height) = draggingZone where recognizer.state == .Began { + if case let .some(height) = draggingZone, recognizer.state == .began { if location.y < view.frame.maxY - height { return } } - guard recognizer.state != .Began else { + guard recognizer.state != .began else { previousPoint = location return } @@ -345,35 +345,38 @@ public extension FloatingViewLayout { if view.frame.contains(location) { move(view: view, in: _direction) } else { - if case .Down(_) = _direction where state == .Moved { + if case .down(_) = _direction, state == .moved { move(view: view, in: _direction) } else if allowPanOutside { move(view: view, in: _direction) } } - if recognizer.state == .Ended && state == .Moved { + if recognizer.state == .ended { self.previousPoint = nil + guard state == .moved else { + return + } + if abs(velocity.y) >= 1000.0 || crossedEnough(view: view, in: _direction) { - if case .Up(_) = _direction { - restore(view: view, to: .Folded, animated: true) - } else if case .Down(_) = _direction { - restore(view: view, to: .Unfolded, animated: true) + if case .up(_) = _direction { + restore(view: view, to: .folded, animated: true) + } else if case .down(_) = _direction { + restore(view: view, to: .unfolded, animated: true) } else { restore(view: view, to: closestState(of: view), animated: true) } } else { - if case .Up(_) = _direction { - restore(view: view, to: .Unfolded, animated: true) - } else if case .Down(_) = _direction { - restore(view: view, to: .Folded, animated: true) + if case .up(_) = _direction { + restore(view: view, to: .unfolded, animated: true) + } else if case .down(_) = _direction { + restore(view: view, to: .folded, animated: true) } else { restore(view: view, to: closestState(of: view), animated: true) } } } - } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/LinesView.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/LinesView.swift index d4280c6..ce8e343 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/LinesView.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/LinesView.swift @@ -12,13 +12,13 @@ import UIKit /// Draws the horizontal and vertical lines to show /// that a cropping is happening right now. /// -public final class LinesView: UIView { - public var lines = 3 { didSet { setNeedsDisplay() } } - public var columns = 3 { didSet { setNeedsDisplay() } } - public var width: CGFloat = 1 { didSet { setNeedsDisplay() } } - public var color = UIColor.whiteColor() { didSet { setNeedsDisplay() } } +open class LinesView: UIView { + open var lines = 3 { didSet { setNeedsDisplay() } } + open var columns = 3 { didSet { setNeedsDisplay() } } + open var width: CGFloat = 1 { didSet { setNeedsDisplay() } } + open var color = UIColor.white { didSet { setNeedsDisplay() } } - override public func drawRect(rect: CGRect) { + override open func draw(_ rect: CGRect) { let verticalSpace = rect.height / CGFloat(lines) let horizontalSpace = rect.width / CGFloat(columns) @@ -50,4 +50,4 @@ public final class LinesView: UIView { rectPath.lineWidth = width rectPath.stroke() } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/NSIndexSet.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/NSIndexSet.swift index 705acfd..85e25a0 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/NSIndexSet.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/NSIndexSet.swift @@ -8,15 +8,15 @@ import Foundation -internal extension NSIndexSet { - func indexPaths(from section: Int) -> [NSIndexPath] { - var indexPaths: [NSIndexPath] = [] +internal extension IndexSet { + func indexPaths(from section: Int) -> [IndexPath] { + var indexPaths: [IndexPath] = [] indexPaths.reserveCapacity(count) - enumerateIndexesUsingBlock { idx, stop in - indexPaths.append(NSIndexPath(forItem: idx, inSection: section)) + forEach { + indexPaths.append(IndexPath(item: $0, section: section)) } return indexPaths } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCachable.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCachable.swift index 5b0563c..b28fb89 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCachable.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCachable.swift @@ -49,7 +49,7 @@ public extension PhotoCachable { /// func resetCachedAssets() { cachingImageManager.stopCachingImagesForAllAssets() - previousPreheatRect = CGRectZero + previousPreheatRect = CGRect.zero } /// @@ -70,22 +70,22 @@ public extension PhotoCachable { var assetsToStopCaching: [PHAsset] = [] difference.forEach { diff in - if case .Added(let area) = diff { + if case .added(let area) = diff { assetsToStartCaching += self.cachingAssets(at: area) - } else if case .Removed(let area) = diff { + } else if case .removed(let area) = diff { assetsToStopCaching += self.cachingAssets(at: area) } } - cachingImageManager.startCachingImagesForAssets(assetsToStartCaching, + cachingImageManager.startCachingImages(for: assetsToStartCaching, targetSize: targetSize, - contentMode: .AspectFill, + contentMode: .aspectFill, options: nil) - cachingImageManager.stopCachingImagesForAssets(assetsToStopCaching, + cachingImageManager.stopCachingImages(for: assetsToStopCaching, targetSize: targetSize, - contentMode: .AspectFill, + contentMode: .aspectFill, options: nil) previousPreheatRect = preheatRect @@ -103,7 +103,7 @@ public extension PhotoCachable { /// - parameter fetchResult: Current fetch result object. /// - returns: An array with assets found. /// - func assets(at indexPaths: [NSIndexPath], in fetchResult: PHFetchResult) -> [PHAsset] { + func assets(at indexPaths: [IndexPath], in fetchResult: PHFetchResult) -> [PHAsset] { guard indexPaths.count > 0 else { return [] } diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCapturable.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCapturable.swift index 2139b0b..91814eb 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCapturable.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoCapturable.swift @@ -18,7 +18,7 @@ public protocol PhotoCapturable: Capturable { /// /// - parameter handler: A handler that is called when the image is taken. Default value is `nil`. /// - func captureStillImage(handler: ((UIImage) -> Void)?) + func captureStillImage(_ handler: ((UIImage) -> Void)?) } // MARK: - Default implementations @@ -30,20 +30,22 @@ public extension PhotoCapturable { /// /// - parameter handler: A handler that is called when the image is taken. Default value is `nil`. /// - func captureStillImage(handler: ((UIImage) -> Void)? = nil) { + func captureStillImage(_ handler: ((UIImage) -> Void)? = nil) { guard let imageOutput = imageOutput else { return } - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { - let videoConnection = imageOutput.connectionWithMediaType(AVMediaTypeVideo) + + + DispatchQueue.global(qos: DispatchQoS.userInitiated.qosClass).async(execute: { + let videoConnection = imageOutput.connection(withMediaType: AVMediaTypeVideo) - imageOutput.captureStillImageAsynchronouslyFromConnection(videoConnection, completionHandler: { (buffer, error) in + imageOutput.captureStillImageAsynchronously(from: videoConnection, completionHandler: { (buffer, error) in self.session?.stopRunning() let data = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(buffer) - if let image = UIImage(data: data) { + if let image = UIImage(data: data!) { // Image size let iw = image.size.width @@ -55,13 +57,11 @@ public extension PhotoCapturable { // The center coordinate along Y axis let rcy = ih * 0.5 - let imageRef = CGImageCreateWithImageInRect( - image.CGImage, - CGRect(x: rcy - iw * 0.5, y: 0 , width: iw, height: iw) + let imageRef = image.cgImage?.cropping(to: CGRect(x: rcy - iw * 0.5, y: 0 , width: iw, height: iw) ) - dispatch_async(dispatch_get_main_queue()) { - let resizedImage = UIImage(CGImage: imageRef!, scale: sw/iw, orientation: image.imageOrientation) + DispatchQueue.main.async { + let resizedImage = UIImage(cgImage: imageRef!, scale: sw/iw, orientation: image.imageOrientation) handler?(resizedImage) self.session = nil @@ -75,4 +75,4 @@ public extension PhotoCapturable { }) } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoFetchable.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoFetchable.swift index fe74824..f496b44 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoFetchable.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/PhotoFetchable.swift @@ -14,11 +14,11 @@ import Photos /// public protocol PhotoFetchable { /// Current fetch result object. - var fetchResult: PHFetchResult { get set } + var fetchResult: PHFetchResult { get set } /// /// Checks if a user has given permission to use /// her photo assets for the app. /// func checkPhotoAuth() -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UICollectionView.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UICollectionView.swift index fc25b61..a45a681 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UICollectionView.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UICollectionView.swift @@ -9,8 +9,8 @@ import UIKit internal extension UICollectionView { - func indexPaths(for rect: CGRect) -> [NSIndexPath] { - guard let allLayoutAttributes = collectionViewLayout.layoutAttributesForElementsInRect(rect) else { + func indexPaths(for rect: CGRect) -> [IndexPath] { + guard let allLayoutAttributes = collectionViewLayout.layoutAttributesForElements(in: rect) else { return [] } @@ -22,4 +22,4 @@ internal extension UICollectionView { return indexPaths } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UIView.swift b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UIView.swift index 3451a8a..87f8b32 100644 --- a/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UIView.swift +++ b/Example/Athlee-ImageEditorKit/Pods/ImagePickerKit/Source/UIView.swift @@ -11,10 +11,10 @@ import UIKit internal extension UIView { func snapshot() -> UIImage { UIGraphicsBeginImageContextWithOptions(frame.size, true, 0) - drawViewHierarchyInRect(bounds, afterScreenUpdates: false) + drawHierarchy(in: bounds, afterScreenUpdates: false) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() - return image + return image! } -} \ No newline at end of file +} diff --git a/Example/Athlee-ImageEditorKit/Pods/Manifest.lock b/Example/Athlee-ImageEditorKit/Pods/Manifest.lock index 68bb776..e70fc7f 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Manifest.lock +++ b/Example/Athlee-ImageEditorKit/Pods/Manifest.lock @@ -1,12 +1,12 @@ PODS: - - ImagePickerKit (0.2.3) + - ImagePickerKit (0.2.4) DEPENDENCIES: - - ImagePickerKit (~> 0.2.3) + - ImagePickerKit (~> 0.2.4) SPEC CHECKSUMS: - ImagePickerKit: 21dcc7162dff7cf557f1e7f7f4bd6b8716d327af + ImagePickerKit: 157c106e76fe07c7952752b68751661d8da3d188 -PODFILE CHECKSUM: ca864079c1326de0c3b1954af44b67d84175e781 +PODFILE CHECKSUM: 1f15b63c182d4bcdc03d9bcfb417684637e91d9a -COCOAPODS: 1.0.1 +COCOAPODS: 1.1.1 diff --git a/Example/Athlee-ImageEditorKit/Pods/Pods.xcodeproj/project.pbxproj b/Example/Athlee-ImageEditorKit/Pods/Pods.xcodeproj/project.pbxproj index 58ab9ac..d1b7d8e 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Athlee-ImageEditorKit/Pods/Pods.xcodeproj/project.pbxproj @@ -7,42 +7,42 @@ objects = { /* Begin PBXBuildFile section */ - 0191403F8845A5232DC3BB9FD09AC4D2 /* CropableScrollViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F23C1FB5EA4155D4B626E5EE82125D6 /* CropableScrollViewDelegate.swift */; }; - 0A93CEA2456C9798ADF7272A365DAB97 /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B89D11E46740CD30521408716BCA4078 /* UIView.swift */; }; - 1885ACDF187A7E3B0A4C7E4BF8F2D38F /* Pods-Athlee-ImageEditorKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C66E17DE2FF7A9F02F89A3ABD1B6A169 /* Pods-Athlee-ImageEditorKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1E877241A35DC462ED5D5EC9B1F5E22F /* FloatingViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E9D3BACEB84BF3ADA25A42CD40C026 /* FloatingViewLayout.swift */; }; - 24A92530A5FBE127BD7202CA5AF4F8BE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; - 4E32797DAC15609B79954C673AB9AB8B /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790BA2D4BF05D693DD998E68EBABB942 /* CGRect.swift */; }; - 50F2D92E3566DC32D1C2449DFBBD75BD /* ImagePickerKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2095FDC766FC488D0DA03BC9D54AED5 /* ImagePickerKit-dummy.m */; }; - 55FB4FA676F386D9D485652B166F4163 /* CaptureNotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1FB3051A4CF4FCC647EFC56C5839B3 /* CaptureNotificationObserver.swift */; }; - 64CAFD93E5587E757C57D2AEB0AEC649 /* PhotoCachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE104E4C6FEC84F691A3841F02B3089 /* PhotoCachable.swift */; }; - 689D42C1C7B6FD3F58D2CF5097A379ED /* Capturable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DC30FB49ED8E130CF5D4ADCF6368BC /* Capturable.swift */; }; - 8C319189B0ACA2844CF956F235A1A5EE /* Cropable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91453857774FE0227D7C5CC7B2CB7721 /* Cropable.swift */; }; - 9D2B4F8316DEEA937D264DEFD695FA38 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; - 9D776D850AA3B6829D8454E061FAC311 /* LinesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6C4D5C156CBC744AD897100B69CBEC3 /* LinesView.swift */; }; - 9E6017C20B3C47F89E2EEDE4EE72FB12 /* PhotoFetchable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8716D4064FF68F65EAA4B187D48E75CD /* PhotoFetchable.swift */; }; - A0C51A52D0A0F8D78F78B0227AD0E0A2 /* NSIndexSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = D170C4A28E63EBE15EACEC6EE3EB3F1D /* NSIndexSet.swift */; }; - A514977C74C448A86541A7F923ADAA17 /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0ABA58CE525FD3FD35ABC410C3A76F8 /* UICollectionView.swift */; }; - A9EFD1A4445B9CC175F287369FD62DDF /* ImagePickerKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3663AD05A3E5643FA228E23F820182C5 /* ImagePickerKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D4AF98FDE17BA5FB2EE60DFA584335DB /* Pods-Athlee-ImageEditorKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 10DE656B4F5FA00FB06B5F2AB126C9F2 /* Pods-Athlee-ImageEditorKit-dummy.m */; }; - F8ED92325D125A23D9215FE7C84C2FEB /* CollectionViewChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6D5485E398EEC39162325B995A290BA /* CollectionViewChangeObserver.swift */; }; - FC44EA32CA6E97574C05A9D77B92BFA5 /* PhotoCapturable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96CB89EF23E90BE71C0963C81A5B128 /* PhotoCapturable.swift */; }; + 00C5A665E5B22AE74498311D7ED157A2 /* LinesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6C4D5C156CBC744AD897100B69CBEC3 /* LinesView.swift */; }; + 04883853943FEA070E919BC5566089AB /* CropableScrollViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F23C1FB5EA4155D4B626E5EE82125D6 /* CropableScrollViewDelegate.swift */; }; + 0A4C3AC902DEF0BA8AE6FCFE5F3F525B /* FloatingViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E9D3BACEB84BF3ADA25A42CD40C026 /* FloatingViewLayout.swift */; }; + 1013DC8B91E9905B54A7EB90126FE7CF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 195CD79583AC88DA47DAE7BF2C1545C4 /* Pods-Athlee-ImageEditorKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 10DE656B4F5FA00FB06B5F2AB126C9F2 /* Pods-Athlee-ImageEditorKit-dummy.m */; }; + 1D576296F35BC1395BC09BF74D2293CE /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B89D11E46740CD30521408716BCA4078 /* UIView.swift */; }; + 2E03F06DC6E9C1C736FF00DA377D322A /* Capturable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DC30FB49ED8E130CF5D4ADCF6368BC /* Capturable.swift */; }; + 46FA26FDD71AF75371D934822A588BFF /* PhotoCapturable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96CB89EF23E90BE71C0963C81A5B128 /* PhotoCapturable.swift */; }; + 4C659A14A9954749BA85E730DD934A03 /* ImagePickerKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3663AD05A3E5643FA228E23F820182C5 /* ImagePickerKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65FA28E95A86A6FEAE165D509B47C219 /* Pods-Athlee-ImageEditorKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C66E17DE2FF7A9F02F89A3ABD1B6A169 /* Pods-Athlee-ImageEditorKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 822F7EA03D1DB33D7C72A7211DF2DA74 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 82ED2FAFF08E69091D799B55710493B5 /* CollectionViewChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6D5485E398EEC39162325B995A290BA /* CollectionViewChangeObserver.swift */; }; + 8F6A8A59B27B7FE193B64023A924582A /* NSIndexSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = D170C4A28E63EBE15EACEC6EE3EB3F1D /* NSIndexSet.swift */; }; + 989C6014287F5C7E27E2CC8A8F9A1B3D /* CaptureNotificationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1FB3051A4CF4FCC647EFC56C5839B3 /* CaptureNotificationObserver.swift */; }; + B99ED3C1196780821EA5139B26161B9F /* Cropable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91453857774FE0227D7C5CC7B2CB7721 /* Cropable.swift */; }; + D0A54CED008DC87AEF7082508D0388BC /* PhotoCachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE104E4C6FEC84F691A3841F02B3089 /* PhotoCachable.swift */; }; + D5305606F8C817216EF562E8D2DB0AFA /* ImagePickerKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2095FDC766FC488D0DA03BC9D54AED5 /* ImagePickerKit-dummy.m */; }; + D841BD355186A853E60148FEEBAE1AEF /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0ABA58CE525FD3FD35ABC410C3A76F8 /* UICollectionView.swift */; }; + DFCB127C63F3150D69CE11DF91899DD7 /* PhotoFetchable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8716D4064FF68F65EAA4B187D48E75CD /* PhotoFetchable.swift */; }; + F2FE3D0B39AA87A3AC16D4DC71596EC8 /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790BA2D4BF05D693DD998E68EBABB942 /* CGRect.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - FFC4F7A555BE10CF47C44F97FCD289D3 /* PBXContainerItemProxy */ = { + A6843329FEA495BA03E89E7F203579FD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 182D671A38E14C7411D755D7BF785DBA; + remoteGlobalIDString = B5BD900E5E5A8EE01337DF51009F9188; remoteInfo = ImagePickerKit; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 10DE656B4F5FA00FB06B5F2AB126C9F2 /* Pods-Athlee-ImageEditorKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Athlee-ImageEditorKit-dummy.m"; sourceTree = ""; }; - 17711FE48C59F76B57A7447BCB2C9951 /* ImagePickerKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = ImagePickerKit.modulemap; sourceTree = ""; }; - 2D2379C21635F0E68BC838BEC5CB153A /* ImagePickerKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ImagePickerKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 17711FE48C59F76B57A7447BCB2C9951 /* ImagePickerKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = ImagePickerKit.modulemap; sourceTree = ""; }; + 2D2379C21635F0E68BC838BEC5CB153A /* ImagePickerKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ImagePickerKit.framework; path = ImagePickerKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 320950A60FF8E882E7F69E1422DE30AF /* Pods-Athlee-ImageEditorKit-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Athlee-ImageEditorKit-resources.sh"; sourceTree = ""; }; 3663AD05A3E5643FA228E23F820182C5 /* ImagePickerKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ImagePickerKit-umbrella.h"; sourceTree = ""; }; 4021BBC07A14B3EA08D62FFF85A22B3D /* ImagePickerKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ImagePickerKit-prefix.pch"; sourceTree = ""; }; @@ -54,20 +54,20 @@ 8207B65EF79AB0A0392C0AEBA2192B27 /* Pods-Athlee-ImageEditorKit-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Athlee-ImageEditorKit-acknowledgements.plist"; sourceTree = ""; }; 8716D4064FF68F65EAA4B187D48E75CD /* PhotoFetchable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PhotoFetchable.swift; path = Source/PhotoFetchable.swift; sourceTree = ""; }; 91453857774FE0227D7C5CC7B2CB7721 /* Cropable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cropable.swift; path = Source/Cropable.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 9F1C8F4B4CC1D3DA307A0E71AE0B844D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A2095FDC766FC488D0DA03BC9D54AED5 /* ImagePickerKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ImagePickerKit-dummy.m"; sourceTree = ""; }; A5E8D627266ECF76F783C3F9315D2C65 /* Pods-Athlee-ImageEditorKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Athlee-ImageEditorKit.release.xcconfig"; sourceTree = ""; }; - A618944C5E77FA70B009C46D073971D5 /* Pods_Athlee_ImageEditorKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Athlee_ImageEditorKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A618944C5E77FA70B009C46D073971D5 /* Pods_Athlee_ImageEditorKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Athlee_ImageEditorKit.framework; path = "Pods-Athlee-ImageEditorKit.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; A689FE9874950A8A4A642BC8507257BA /* Pods-Athlee-ImageEditorKit-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Athlee-ImageEditorKit-acknowledgements.markdown"; sourceTree = ""; }; AAA43A466CB97E1D3D9ECCD5246CCF85 /* ImagePickerKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ImagePickerKit.xcconfig; sourceTree = ""; }; AEE104E4C6FEC84F691A3841F02B3089 /* PhotoCachable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PhotoCachable.swift; path = Source/PhotoCachable.swift; sourceTree = ""; }; B0ABA58CE525FD3FD35ABC410C3A76F8 /* UICollectionView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UICollectionView.swift; path = Source/UICollectionView.swift; sourceTree = ""; }; B89D11E46740CD30521408716BCA4078 /* UIView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UIView.swift; path = Source/UIView.swift; sourceTree = ""; }; - BB6D4C623FE2CBEF4D44694A3087B350 /* Pods-Athlee-ImageEditorKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Athlee-ImageEditorKit.modulemap"; sourceTree = ""; }; + BB6D4C623FE2CBEF4D44694A3087B350 /* Pods-Athlee-ImageEditorKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-Athlee-ImageEditorKit.modulemap"; sourceTree = ""; }; C2DC30FB49ED8E130CF5D4ADCF6368BC /* Capturable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Capturable.swift; path = Source/Capturable.swift; sourceTree = ""; }; C66E17DE2FF7A9F02F89A3ABD1B6A169 /* Pods-Athlee-ImageEditorKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Athlee-ImageEditorKit-umbrella.h"; sourceTree = ""; }; - CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; D170C4A28E63EBE15EACEC6EE3EB3F1D /* NSIndexSet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NSIndexSet.swift; path = Source/NSIndexSet.swift; sourceTree = ""; }; D96CB89EF23E90BE71C0963C81A5B128 /* PhotoCapturable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PhotoCapturable.swift; path = Source/PhotoCapturable.swift; sourceTree = ""; }; E3CE561E746C6930DA50FF5951C14C8A /* Pods-Athlee-ImageEditorKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Athlee-ImageEditorKit.debug.xcconfig"; sourceTree = ""; }; @@ -77,19 +77,19 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - A15FD89E0A05EE3734BE5B9A1C4DDB85 /* Frameworks */ = { + 140BD7DC13E3D78276B5C1E6FB0CDBF3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 24A92530A5FBE127BD7202CA5AF4F8BE /* Foundation.framework in Frameworks */, + 822F7EA03D1DB33D7C72A7211DF2DA74 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D3158817B9DD7065B062C2F3569A8AC6 /* Frameworks */ = { + D710E1C4C86345DBB34014E6F772CE56 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9D2B4F8316DEEA937D264DEFD695FA38 /* Foundation.framework in Frameworks */, + 1013DC8B91E9905B54A7EB90126FE7CF /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -115,17 +115,10 @@ B89D11E46740CD30521408716BCA4078 /* UIView.swift */, EB37C7BF02988AB944583EDF58DF9643 /* Support Files */, ); + name = ImagePickerKit; path = ImagePickerKit; sourceTree = ""; }; - 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = { - isa = PBXGroup; - children = ( - CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; 7158542C65F4BA9B3A5CE54049656B61 /* Pods-Athlee-ImageEditorKit */ = { isa = PBXGroup; children = ( @@ -144,6 +137,14 @@ path = "Target Support Files/Pods-Athlee-ImageEditorKit"; sourceTree = ""; }; + 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { + isa = PBXGroup; + children = ( + CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( @@ -158,7 +159,7 @@ BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { isa = PBXGroup; children = ( - 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */, + 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, ); name = Frameworks; sourceTree = ""; @@ -205,58 +206,58 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 0588DBCFA2322D58896BA4D0E0481BE3 /* Headers */ = { + 2156E8E7393A05E6F952B247237BEEDC /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 1885ACDF187A7E3B0A4C7E4BF8F2D38F /* Pods-Athlee-ImageEditorKit-umbrella.h in Headers */, + 4C659A14A9954749BA85E730DD934A03 /* ImagePickerKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - AF7C0701AA4CDB421A13B51C7196957C /* Headers */ = { + EAFC6B2905135B3B4A8AC3E64492E0F0 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - A9EFD1A4445B9CC175F287369FD62DDF /* ImagePickerKit-umbrella.h in Headers */, + 65FA28E95A86A6FEAE165D509B47C219 /* Pods-Athlee-ImageEditorKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 182D671A38E14C7411D755D7BF785DBA /* ImagePickerKit */ = { + 67E2E55BD30786D462FFD34C95468F0F /* Pods-Athlee-ImageEditorKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 710547EDE77793657C06DDBF75A7C315 /* Build configuration list for PBXNativeTarget "ImagePickerKit" */; + buildConfigurationList = 7E846A81F58A700D90F5BC1522C68B3D /* Build configuration list for PBXNativeTarget "Pods-Athlee-ImageEditorKit" */; buildPhases = ( - 550FC08A4435802C8EFA3DF3B218E7D3 /* Sources */, - A15FD89E0A05EE3734BE5B9A1C4DDB85 /* Frameworks */, - AF7C0701AA4CDB421A13B51C7196957C /* Headers */, + 5DCBD7A103C1FBB57F06B8B861CEDA5B /* Sources */, + D710E1C4C86345DBB34014E6F772CE56 /* Frameworks */, + EAFC6B2905135B3B4A8AC3E64492E0F0 /* Headers */, ); buildRules = ( ); dependencies = ( + 5518D638A51F03B89B04C57D1CC4EFC2 /* PBXTargetDependency */, ); - name = ImagePickerKit; - productName = ImagePickerKit; - productReference = 2D2379C21635F0E68BC838BEC5CB153A /* ImagePickerKit.framework */; + name = "Pods-Athlee-ImageEditorKit"; + productName = "Pods-Athlee-ImageEditorKit"; + productReference = A618944C5E77FA70B009C46D073971D5 /* Pods_Athlee_ImageEditorKit.framework */; productType = "com.apple.product-type.framework"; }; - 36BF824508FA3BC44EB8FDA6284F1A60 /* Pods-Athlee-ImageEditorKit */ = { + B5BD900E5E5A8EE01337DF51009F9188 /* ImagePickerKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 4D5C3C37FA194BDFCBD361CD14932293 /* Build configuration list for PBXNativeTarget "Pods-Athlee-ImageEditorKit" */; + buildConfigurationList = 6B78B2D311939C2CD9115C8030547278 /* Build configuration list for PBXNativeTarget "ImagePickerKit" */; buildPhases = ( - 8CF8689C9D3E155D55B833B10BD7292D /* Sources */, - D3158817B9DD7065B062C2F3569A8AC6 /* Frameworks */, - 0588DBCFA2322D58896BA4D0E0481BE3 /* Headers */, + 9F2201CAC00EA4303BF3A0645ED349F7 /* Sources */, + 140BD7DC13E3D78276B5C1E6FB0CDBF3 /* Frameworks */, + 2156E8E7393A05E6F952B247237BEEDC /* Headers */, ); buildRules = ( ); dependencies = ( - 926EA439866D2D3C66FACBC4FC814DBD /* PBXTargetDependency */, ); - name = "Pods-Athlee-ImageEditorKit"; - productName = "Pods-Athlee-ImageEditorKit"; - productReference = A618944C5E77FA70B009C46D073971D5 /* Pods_Athlee_ImageEditorKit.framework */; + name = ImagePickerKit; + productName = ImagePickerKit; + productReference = 2D2379C21635F0E68BC838BEC5CB153A /* ImagePickerKit.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -280,56 +281,88 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 182D671A38E14C7411D755D7BF785DBA /* ImagePickerKit */, - 36BF824508FA3BC44EB8FDA6284F1A60 /* Pods-Athlee-ImageEditorKit */, + B5BD900E5E5A8EE01337DF51009F9188 /* ImagePickerKit */, + 67E2E55BD30786D462FFD34C95468F0F /* Pods-Athlee-ImageEditorKit */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 550FC08A4435802C8EFA3DF3B218E7D3 /* Sources */ = { + 5DCBD7A103C1FBB57F06B8B861CEDA5B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 689D42C1C7B6FD3F58D2CF5097A379ED /* Capturable.swift in Sources */, - 55FB4FA676F386D9D485652B166F4163 /* CaptureNotificationObserver.swift in Sources */, - 4E32797DAC15609B79954C673AB9AB8B /* CGRect.swift in Sources */, - F8ED92325D125A23D9215FE7C84C2FEB /* CollectionViewChangeObserver.swift in Sources */, - 8C319189B0ACA2844CF956F235A1A5EE /* Cropable.swift in Sources */, - 0191403F8845A5232DC3BB9FD09AC4D2 /* CropableScrollViewDelegate.swift in Sources */, - 1E877241A35DC462ED5D5EC9B1F5E22F /* FloatingViewLayout.swift in Sources */, - 50F2D92E3566DC32D1C2449DFBBD75BD /* ImagePickerKit-dummy.m in Sources */, - 9D776D850AA3B6829D8454E061FAC311 /* LinesView.swift in Sources */, - A0C51A52D0A0F8D78F78B0227AD0E0A2 /* NSIndexSet.swift in Sources */, - 64CAFD93E5587E757C57D2AEB0AEC649 /* PhotoCachable.swift in Sources */, - FC44EA32CA6E97574C05A9D77B92BFA5 /* PhotoCapturable.swift in Sources */, - 9E6017C20B3C47F89E2EEDE4EE72FB12 /* PhotoFetchable.swift in Sources */, - A514977C74C448A86541A7F923ADAA17 /* UICollectionView.swift in Sources */, - 0A93CEA2456C9798ADF7272A365DAB97 /* UIView.swift in Sources */, + 195CD79583AC88DA47DAE7BF2C1545C4 /* Pods-Athlee-ImageEditorKit-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 8CF8689C9D3E155D55B833B10BD7292D /* Sources */ = { + 9F2201CAC00EA4303BF3A0645ED349F7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D4AF98FDE17BA5FB2EE60DFA584335DB /* Pods-Athlee-ImageEditorKit-dummy.m in Sources */, + 2E03F06DC6E9C1C736FF00DA377D322A /* Capturable.swift in Sources */, + 989C6014287F5C7E27E2CC8A8F9A1B3D /* CaptureNotificationObserver.swift in Sources */, + F2FE3D0B39AA87A3AC16D4DC71596EC8 /* CGRect.swift in Sources */, + 82ED2FAFF08E69091D799B55710493B5 /* CollectionViewChangeObserver.swift in Sources */, + B99ED3C1196780821EA5139B26161B9F /* Cropable.swift in Sources */, + 04883853943FEA070E919BC5566089AB /* CropableScrollViewDelegate.swift in Sources */, + 0A4C3AC902DEF0BA8AE6FCFE5F3F525B /* FloatingViewLayout.swift in Sources */, + D5305606F8C817216EF562E8D2DB0AFA /* ImagePickerKit-dummy.m in Sources */, + 00C5A665E5B22AE74498311D7ED157A2 /* LinesView.swift in Sources */, + 8F6A8A59B27B7FE193B64023A924582A /* NSIndexSet.swift in Sources */, + D0A54CED008DC87AEF7082508D0388BC /* PhotoCachable.swift in Sources */, + 46FA26FDD71AF75371D934822A588BFF /* PhotoCapturable.swift in Sources */, + DFCB127C63F3150D69CE11DF91899DD7 /* PhotoFetchable.swift in Sources */, + D841BD355186A853E60148FEEBAE1AEF /* UICollectionView.swift in Sources */, + 1D576296F35BC1395BC09BF74D2293CE /* UIView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 926EA439866D2D3C66FACBC4FC814DBD /* PBXTargetDependency */ = { + 5518D638A51F03B89B04C57D1CC4EFC2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = ImagePickerKit; - target = 182D671A38E14C7411D755D7BF785DBA /* ImagePickerKit */; - targetProxy = FFC4F7A555BE10CF47C44F97FCD289D3 /* PBXContainerItemProxy */; + target = B5BD900E5E5A8EE01337DF51009F9188 /* ImagePickerKit */; + targetProxy = A6843329FEA495BA03E89E7F203579FD /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 034014829C1E4434983CF3A690C12017 /* Debug */ = { + 3973531135A6D908493AC456D55749FD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AAA43A466CB97E1D3D9ECCD5246CCF85 /* ImagePickerKit.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/ImagePickerKit/ImagePickerKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/ImagePickerKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/ImagePickerKit/ImagePickerKit.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = ImagePickerKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -347,6 +380,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -366,18 +400,61 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; }; name = Debug; }; - 0D0C5769897CDD328DB325A809203662 /* Release */ = { + B7324857C38B065FEB1EEE3105C2367A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A5E8D627266ECF76F783C3F9315D2C65 /* Pods-Athlee-ImageEditorKit.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C429CE185CFAADC421CE0A4BBD6574FD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E3CE561E746C6930DA50FF5951C14C8A /* Pods-Athlee-ImageEditorKit.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -390,7 +467,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; + MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -398,17 +475,21 @@ PRODUCT_NAME = Pods_Athlee_ImageEditorKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 16C1DE7317DDFD06B908C865B82D774A /* Debug */ = { + CB3CD99157B8EB10BECF4780AF77A138 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = AAA43A466CB97E1D3D9ECCD5246CCF85 /* ImagePickerKit.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; @@ -428,17 +509,20 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 899CFE0562FC4CB11092C53BE875BE39 /* Release */ = { + E54755FED589BFE11F4E28D6C938C3DA /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AAA43A466CB97E1D3D9ECCD5246CCF85 /* ImagePickerKit.xcconfig */; + baseConfigurationReference = A5E8D627266ECF76F783C3F9315D2C65 /* Pods-Athlee-ImageEditorKit.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -447,80 +531,13 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ImagePickerKit/ImagePickerKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/ImagePickerKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/ImagePickerKit/ImagePickerKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = ImagePickerKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - C7E474A03CAE21F1CB6046E7344C59BD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - FA2E9FF2418D72FCA26C177A86A7737D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E3CE561E746C6930DA50FF5951C14C8A /* Pods-Athlee-ImageEditorKit.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Target Support Files/Pods-Athlee-ImageEditorKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -528,12 +545,12 @@ PRODUCT_NAME = Pods_Athlee_ImageEditorKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; /* End XCBuildConfiguration section */ @@ -541,26 +558,26 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 034014829C1E4434983CF3A690C12017 /* Debug */, - C7E474A03CAE21F1CB6046E7344C59BD /* Release */, + 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */, + B7324857C38B065FEB1EEE3105C2367A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4D5C3C37FA194BDFCBD361CD14932293 /* Build configuration list for PBXNativeTarget "Pods-Athlee-ImageEditorKit" */ = { + 6B78B2D311939C2CD9115C8030547278 /* Build configuration list for PBXNativeTarget "ImagePickerKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - FA2E9FF2418D72FCA26C177A86A7737D /* Debug */, - 0D0C5769897CDD328DB325A809203662 /* Release */, + CB3CD99157B8EB10BECF4780AF77A138 /* Debug */, + 3973531135A6D908493AC456D55749FD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 710547EDE77793657C06DDBF75A7C315 /* Build configuration list for PBXNativeTarget "ImagePickerKit" */ = { + 7E846A81F58A700D90F5BC1522C68B3D /* Build configuration list for PBXNativeTarget "Pods-Athlee-ImageEditorKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 16C1DE7317DDFD06B908C865B82D774A /* Debug */, - 899CFE0562FC4CB11092C53BE875BE39 /* Release */, + C429CE185CFAADC421CE0A4BBD6574FD /* Debug */, + E54755FED589BFE11F4E28D6C938C3DA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/ImagePickerKit-umbrella.h b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/ImagePickerKit-umbrella.h index 7bd9ad2..1c8b9da 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/ImagePickerKit-umbrella.h +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/ImagePickerKit-umbrella.h @@ -1,4 +1,6 @@ +#ifdef __OBJC__ #import +#endif FOUNDATION_EXPORT double ImagePickerKitVersionNumber; diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/Info.plist b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/Info.plist index 421cf1d..f7c6cd4 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/Info.plist +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/ImagePickerKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.2.3 + 0.2.4 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-acknowledgements.plist b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-acknowledgements.plist index 1165251..e52c927 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-acknowledgements.plist +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-acknowledgements.plist @@ -36,6 +36,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + License + MIT Title ImagePickerKit Type diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-resources.sh b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-resources.sh index 0a15615..25e9d37 100755 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-resources.sh +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-resources.sh @@ -23,12 +23,6 @@ case "${TARGETED_DEVICE_FAMILY}" in ;; esac -realpath() { - DIRECTORY="$(cd "${1%/*}" && pwd)" - FILENAME="${1##*/}" - echo "$DIRECTORY/$FILENAME" -} - install_resource() { if [[ "$1" = /* ]] ; then @@ -70,7 +64,7 @@ EOM xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) - ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) @@ -93,7 +87,7 @@ then # Find all other xcassets (this unfortunately includes those of path pods and other targets). OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) while read line; do - if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + if [[ $line != "${PODS_ROOT}*" ]]; then XCASSET_FILES+=("$line") fi done <<<"$OTHER_XCASSETS" diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-umbrella.h b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-umbrella.h index 93384e1..5e83980 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-umbrella.h +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit-umbrella.h @@ -1,4 +1,6 @@ +#ifdef __OBJC__ #import +#endif FOUNDATION_EXPORT double Pods_Athlee_ImageEditorKitVersionNumber; diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.debug.xcconfig b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.debug.xcconfig index 9273127..04d8a72 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.debug.xcconfig +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.debug.xcconfig @@ -1,3 +1,4 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ImagePickerKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 diff --git a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.release.xcconfig b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.release.xcconfig index 9273127..04d8a72 100644 --- a/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.release.xcconfig +++ b/Example/Athlee-ImageEditorKit/Pods/Target Support Files/Pods-Athlee-ImageEditorKit/Pods-Athlee-ImageEditorKit.release.xcconfig @@ -1,3 +1,4 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ImagePickerKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 diff --git a/Source/.DS_Store b/Source/.DS_Store new file mode 100644 index 0000000..65bbe33 Binary files /dev/null and b/Source/.DS_Store differ diff --git a/Source/ImageProcessor/.DS_Store b/Source/ImageProcessor/.DS_Store new file mode 100644 index 0000000..1d4cb2a Binary files /dev/null and b/Source/ImageProcessor/.DS_Store differ diff --git a/Source/ImageProcessor/Categories/.DS_Store b/Source/ImageProcessor/Categories/.DS_Store new file mode 100644 index 0000000..082c190 Binary files /dev/null and b/Source/ImageProcessor/Categories/.DS_Store differ diff --git a/Source/ImageProcessor/Categories/ColorEffectFilter.swift b/Source/ImageProcessor/Categories/ColorEffectFilter.swift index c0a6e65..7c17fdd 100644 --- a/Source/ImageProcessor/Categories/ColorEffectFilter.swift +++ b/Source/ImageProcessor/Categories/ColorEffectFilter.swift @@ -14,8 +14,8 @@ public protocol ColorEffectFilter: ImageFilter { var inputGreenCoefficients: CIVector? { get set } var inputBlueCoefficients: CIVector? { get set } var inputCubeDimension: NSNumber? { get set } - var inputCubeData: NSData? { get set } - var inputColorSpace: CGColorSpaceRef? { get set } + var inputCubeData: Data? { get set } + var inputColorSpace: CGColorSpace? { get set } var inputGradientImage: CIImage? { get set } var inputColor: CIColor? { get set } var inputIntensity: NSNumber? { get set } @@ -47,12 +47,12 @@ public extension ColorEffectFilter { set { } } - var inputCubeData: NSData? { + var inputCubeData: Data? { get { return nil } set { } } - var inputColorSpace: CGColorSpaceRef? { + var inputColorSpace: CGColorSpace? { get { return nil } set { } } @@ -96,4 +96,4 @@ public extension ColorEffectFilter { get { return nil } set { } } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Categories/Filter.swift b/Source/ImageProcessor/Categories/Filter.swift index ba03a87..dbfbbfd 100644 --- a/Source/ImageProcessor/Categories/Filter.swift +++ b/Source/ImageProcessor/Categories/Filter.swift @@ -8,8 +8,8 @@ import CoreImage -public enum FilterError: ErrorType { - case FilterDoesNotExist(String) +public enum FilterError: Error { + case filterDoesNotExist(String) } public protocol Filter: Scanable, Equatable, Hashable { @@ -33,7 +33,7 @@ public extension Filter { if let filter = CIFilter(name: name) { return filter } else { - throw FilterError.FilterDoesNotExist(name) + throw FilterError.filterDoesNotExist(name) } } } @@ -43,4 +43,4 @@ public func ==(lhs: T, rhs: T) -> Bool { guard let rhsFilter = try? rhs.filter() else { return false } return lhsFilter == rhsFilter -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Extensions/.DS_Store b/Source/ImageProcessor/Extensions/.DS_Store new file mode 100644 index 0000000..4669d86 Binary files /dev/null and b/Source/ImageProcessor/Extensions/.DS_Store differ diff --git a/Source/ImageProcessor/Extensions/Any.swift b/Source/ImageProcessor/Extensions/Any.swift index 1792907..f1274da 100644 --- a/Source/ImageProcessor/Extensions/Any.swift +++ b/Source/ImageProcessor/Extensions/Any.swift @@ -8,12 +8,12 @@ import Foundation -internal func unwrapped(any: Any) -> Any { +internal func unwrapped(_ any: Any) -> Any { var value = any while true { let mirror = Mirror(reflecting: value) - if let style = mirror.displayStyle where style == .Optional { + if let style = mirror.displayStyle, style == .optional { guard let first = mirror.children.first else { break } @@ -25,4 +25,4 @@ internal func unwrapped(any: Any) -> Any { } return value -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Extensions/UIImage.swift b/Source/ImageProcessor/Extensions/UIImage.swift index decb163..c574bc8 100644 --- a/Source/ImageProcessor/Extensions/UIImage.swift +++ b/Source/ImageProcessor/Extensions/UIImage.swift @@ -13,10 +13,10 @@ typealias _CIImage = CIImage internal extension UIImage { var extent: CGRect { - guard let image = CGImage else { + guard let image = cgImage else { return .zero } - return _CIImage(CGImage: image).extent + return _CIImage(cgImage: image).extent } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/.DS_Store b/Source/ImageProcessor/Filters/.DS_Store new file mode 100644 index 0000000..ea0dd93 Binary files /dev/null and b/Source/ImageProcessor/Filters/.DS_Store differ diff --git a/Source/ImageProcessor/Filters/BlurFilters/.DS_Store b/Source/ImageProcessor/Filters/BlurFilters/.DS_Store new file mode 100644 index 0000000..44d4a07 Binary files /dev/null and b/Source/ImageProcessor/Filters/BlurFilters/.DS_Store differ diff --git a/Source/ImageProcessor/Filters/BlurFilters/GaussianBlurFilter.swift b/Source/ImageProcessor/Filters/BlurFilters/GaussianBlurFilter.swift index 7cf840f..257caee 100644 --- a/Source/ImageProcessor/Filters/BlurFilters/GaussianBlurFilter.swift +++ b/Source/ImageProcessor/Filters/BlurFilters/GaussianBlurFilter.swift @@ -36,7 +36,7 @@ public struct GaussianBlurFilter: BlurFilter { public init(image: UIImage, inputRadius: Float) { self.image = image self.inputImage = CIImage(image: image) - self.inputRadius = NSNumber(float: inputRadius) + self.inputRadius = NSNumber(value: inputRadius as Float) } } diff --git a/Source/ImageProcessor/Filters/ColorAdjustmentFilters/.DS_Store b/Source/ImageProcessor/Filters/ColorAdjustmentFilters/.DS_Store new file mode 100644 index 0000000..2d88544 Binary files /dev/null and b/Source/ImageProcessor/Filters/ColorAdjustmentFilters/.DS_Store differ diff --git a/Source/ImageProcessor/Filters/ColorAdjustmentFilters/ColorControlsFilter.swift b/Source/ImageProcessor/Filters/ColorAdjustmentFilters/ColorControlsFilter.swift index 3c2b89f..aa52433 100644 --- a/Source/ImageProcessor/Filters/ColorAdjustmentFilters/ColorControlsFilter.swift +++ b/Source/ImageProcessor/Filters/ColorAdjustmentFilters/ColorControlsFilter.swift @@ -34,9 +34,9 @@ public struct ColorControlsFilter: ColorAdjustmentFilter { inputContrast: Float = 1.0) { self.image = image self.inputImage = CIImage(image: image) - self.inputSaturation = NSNumber(float: inputSaturation) - self.inputBrightness = NSNumber(float: inputBrightness) - self.inputContrast = NSNumber(float: inputContrast) + self.inputSaturation = NSNumber(value: inputSaturation as Float) + self.inputBrightness = NSNumber(value: inputBrightness as Float) + self.inputContrast = NSNumber(value: inputContrast as Float) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/.DS_Store b/Source/ImageProcessor/Filters/ColorEffectFilters/.DS_Store new file mode 100644 index 0000000..5fea193 Binary files /dev/null and b/Source/ImageProcessor/Filters/ColorEffectFilters/.DS_Store differ diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/ColorMonochromeFilter.swift b/Source/ImageProcessor/Filters/ColorEffectFilters/ColorMonochromeFilter.swift index c43d1e2..bc4bc10 100644 --- a/Source/ImageProcessor/Filters/ColorEffectFilters/ColorMonochromeFilter.swift +++ b/Source/ImageProcessor/Filters/ColorEffectFilters/ColorMonochromeFilter.swift @@ -31,7 +31,7 @@ public struct ColorMonochromeFilter: ColorEffectFilter { self.image = image self.inputImage = CIImage(image: image) self.inputColor = CIColor(color: color) - self.inputIntensity = NSNumber(float: intensity) + self.inputIntensity = NSNumber(value: intensity as Float) } } diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/ColorPosterizeFilter.swift b/Source/ImageProcessor/Filters/ColorEffectFilters/ColorPosterizeFilter.swift index 72ff457..cf8e684 100644 --- a/Source/ImageProcessor/Filters/ColorEffectFilters/ColorPosterizeFilter.swift +++ b/Source/ImageProcessor/Filters/ColorEffectFilters/ColorPosterizeFilter.swift @@ -29,7 +29,7 @@ public struct ColorPosterizeFilter: ColorEffectFilter { public init(image: UIImage, inputLevels: Float = 6.0) { self.image = image self.inputImage = CIImage(image: image) - self.inputLevels = NSNumber(float: inputLevels) + self.inputLevels = NSNumber(value: inputLevels as Float) } } diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/SepiaToneFilter.swift b/Source/ImageProcessor/Filters/ColorEffectFilters/SepiaToneFilter.swift index 65018b3..e416074 100644 --- a/Source/ImageProcessor/Filters/ColorEffectFilters/SepiaToneFilter.swift +++ b/Source/ImageProcessor/Filters/ColorEffectFilters/SepiaToneFilter.swift @@ -29,7 +29,7 @@ public struct SepiaToneFilter: ColorEffectFilter { public init(image: UIImage, intensity: Float = 1.0) { self.image = image self.inputImage = CIImage(image: image) - self.inputIntensity = NSNumber(float: intensity) + self.inputIntensity = NSNumber(value: intensity as Float) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteEffectFilter.swift b/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteEffectFilter.swift index 4482934..f6d3299 100644 --- a/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteEffectFilter.swift +++ b/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteEffectFilter.swift @@ -34,9 +34,9 @@ public struct VignetteEffectFilter: ColorEffectFilter { intensity: Float = 0.0) { self.image = image self.inputImage = CIImage(image: image) - self.inputCenter = CIVector(CGPoint: inputCenter) - self.inputRadius = NSNumber(float: inputRadius) - self.inputIntensity = NSNumber(float: intensity) + self.inputCenter = CIVector(cgPoint: inputCenter) + self.inputRadius = NSNumber(value: inputRadius as Float) + self.inputIntensity = NSNumber(value: intensity as Float) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteFilter.swift b/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteFilter.swift index 6aafc0b..2db9cef 100644 --- a/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteFilter.swift +++ b/Source/ImageProcessor/Filters/ColorEffectFilters/VignetteFilter.swift @@ -30,8 +30,8 @@ public struct VignetteFilter: ColorEffectFilter { public init(image: UIImage, inputRadius: Float = 1.0, intensity: Float = 0.0) { self.image = image self.inputImage = CIImage(image: image) - self.inputRadius = NSNumber(float: inputRadius) - self.inputIntensity = NSNumber(float: intensity) + self.inputRadius = NSNumber(value: inputRadius as Float) + self.inputIntensity = NSNumber(value: intensity as Float) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/.DS_Store b/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/.DS_Store new file mode 100644 index 0000000..6d2eaba Binary files /dev/null and b/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/.DS_Store differ diff --git a/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/AffineTransformFilter.swift b/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/AffineTransformFilter.swift index e72b339..8219c04 100644 --- a/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/AffineTransformFilter.swift +++ b/Source/ImageProcessor/Filters/GeometryAdjustmentFilters/AffineTransformFilter.swift @@ -19,6 +19,6 @@ public struct AffineTransformFilter: GeometryAdjustment { public init(image: UIImage, inputTransform: CGAffineTransform) { self.image = image self.inputImage = CIImage(image: image) - self.inputTransform = NSValue(CGAffineTransform: inputTransform) + self.inputTransform = NSValue(cgAffineTransform: inputTransform) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Filters/TileEffectFilters/.DS_Store b/Source/ImageProcessor/Filters/TileEffectFilters/.DS_Store new file mode 100644 index 0000000..3a65f72 Binary files /dev/null and b/Source/ImageProcessor/Filters/TileEffectFilters/.DS_Store differ diff --git a/Source/ImageProcessor/Helpers/.DS_Store b/Source/ImageProcessor/Helpers/.DS_Store new file mode 100644 index 0000000..4f52d26 Binary files /dev/null and b/Source/ImageProcessor/Helpers/.DS_Store differ diff --git a/Source/ImageProcessor/Helpers/FilterErrorPrinter.swift b/Source/ImageProcessor/Helpers/FilterErrorPrinter.swift index b59b248..073338d 100644 --- a/Source/ImageProcessor/Helpers/FilterErrorPrinter.swift +++ b/Source/ImageProcessor/Helpers/FilterErrorPrinter.swift @@ -9,13 +9,13 @@ import Foundation public struct FilterErrorPrinter { - public static func printError(error: FilterError) { + public static func printError(_ error: FilterError) { let message: String switch error { - case .FilterDoesNotExist(let name): + case .filterDoesNotExist(let name): message = "Unable to find filter in CoreFilter library named: \(name)." } print(message) } -} \ No newline at end of file +} diff --git a/Source/ImageProcessor/Processor/.DS_Store b/Source/ImageProcessor/Processor/.DS_Store new file mode 100644 index 0000000..4d2642e Binary files /dev/null and b/Source/ImageProcessor/Processor/.DS_Store differ diff --git a/Source/ImageProcessor/Processor/ImageProcessor.swift b/Source/ImageProcessor/Processor/ImageProcessor.swift index bcaf934..75f4e47 100644 --- a/Source/ImageProcessor/Processor/ImageProcessor.swift +++ b/Source/ImageProcessor/Processor/ImageProcessor.swift @@ -11,11 +11,11 @@ import CoreImage public struct ImageProcessor: ImageProcessorType { - private class Store { + fileprivate class Store { var filters: [String: CIFilter] = [:] - private lazy var queue: NSOperationQueue = { - let queue = NSOperationQueue() + fileprivate lazy var queue: OperationQueue = { + let queue = OperationQueue() queue.maxConcurrentOperationCount = 1 return queue }() @@ -23,9 +23,9 @@ public struct ImageProcessor: ImageProcessorType { // MARK: Properties - private let context = CIContext() - private let store = Store() - private var queue: NSOperationQueue { + fileprivate let context = CIContext() + fileprivate let store = Store() + fileprivate var queue: OperationQueue { return store.queue } @@ -35,16 +35,16 @@ public struct ImageProcessor: ImageProcessorType { // MARK: ImageProcessorType properties - public func process(image image: UIImage, filter: T, completion: (UIImage?) -> Void) { + public func process(image: UIImage, filter: T, completion: (UIImage?) -> Void) { print("[ImageProcessor]: Unable to find appropriate processing method's overload...") } // MARK: BlurFilter - public func process(image image: UIImage, + public func process(image: UIImage, filter: T, - completion: (UIImage?) -> Void) { - let transformValue = NSValue(CGAffineTransform: CGAffineTransformMakeScale(1, 1)) + completion: @escaping (UIImage?) -> Void) { + let transformValue = NSValue(cgAffineTransform: CGAffineTransform(scaleX: 1, y: 1)) let transform = AffineClampFilter(image: image, inputTransform: transformValue) add(filter: filter) @@ -71,7 +71,7 @@ public struct ImageProcessor: ImageProcessorType { } queue.cancelAllOperations() - queue.addOperationWithBlock { + queue.addOperation { let output = self.convertedImage(from: result.image, extent: scaleResult.originalExtent) completion(output) } @@ -79,9 +79,9 @@ public struct ImageProcessor: ImageProcessorType { // MARK: TileEffect - public func process(image image: UIImage, + public func process(image: UIImage, filter: T, - completion: (UIImage?) -> Void) { + completion: @escaping (UIImage?) -> Void) { add(filter: filter) let _result = processedImageResult(with: image, filter: filter) { image, _filter in @@ -94,7 +94,7 @@ public struct ImageProcessor: ImageProcessorType { } queue.cancelAllOperations() - queue.addOperationWithBlock { + queue.addOperation { let output = self.convertedImage(from: result.image, extent: filter.inputImage?.extent ?? .zero) completion(output) } @@ -102,9 +102,9 @@ public struct ImageProcessor: ImageProcessorType { // MARK: ColorEffectFilters - public func process(image image: UIImage, + public func process(image: UIImage, filter: T, - completion: (UIImage?) -> Void) { + completion: @escaping (UIImage?) -> Void) { add(filter: filter) let _result = processedImageResult(with: image, filter: filter) { image, _filter in @@ -117,7 +117,7 @@ public struct ImageProcessor: ImageProcessorType { } queue.cancelAllOperations() - queue.addOperationWithBlock { + queue.addOperation { let output = self.convertedImage(from: result.image, extent: filter.inputImage?.extent ?? .zero) completion(output) } @@ -125,9 +125,9 @@ public struct ImageProcessor: ImageProcessorType { // MARK: ColorAdjustment - public func process(image image: UIImage, + public func process(image: UIImage, filter: T, - completion: (UIImage?) -> Void) { + completion: @escaping (UIImage?) -> Void) { add(filter: filter) let _result = processedImageResult(with: image, filter: filter) { image, _filter in @@ -140,7 +140,7 @@ public struct ImageProcessor: ImageProcessorType { } queue.cancelAllOperations() - queue.addOperationWithBlock { + queue.addOperation { let output = self.convertedImage(from: result.image, extent: filter.inputImage?.extent ?? .zero) completion(output) } @@ -148,9 +148,9 @@ public struct ImageProcessor: ImageProcessorType { // MARK: GeometryAdjustment - public func process(image image: UIImage, + public func process(image: UIImage, filter: T, - completion: (UIImage?) -> Void) { + completion: @escaping (UIImage?) -> Void) { add(filter: filter) let _result = processedImageResult(with: image, filter: filter) { image, _filter in @@ -163,7 +163,7 @@ public struct ImageProcessor: ImageProcessorType { } queue.cancelAllOperations() - queue.addOperationWithBlock { + queue.addOperation { let output = self.convertedImage(from: result.image, extent: filter.inputImage?.extent ?? .zero) completion(output) } @@ -202,7 +202,7 @@ public struct ImageProcessor: ImageProcessorType { // MARK: - private func add(filter filter: T) { + fileprivate func add(filter: T) { guard store.filters[filter.name] == nil else { return } do { @@ -215,26 +215,26 @@ public struct ImageProcessor: ImageProcessorType { } } - private func preparedImage(with image: UIImage, filter: T) -> CIImage? { - guard let _image = image.CGImage else { + fileprivate func preparedImage(with image: UIImage, filter: T) -> CIImage? { + guard let _image = image.cgImage else { return nil } - let image = CIImage(CGImage: _image) + let image = CIImage(cgImage: _image) return image } - private func convertedImage(from image: CIImage, extent: CGRect) -> UIImage { + fileprivate func convertedImage(from image: CIImage, extent: CGRect) -> UIImage { let _output = self.context.createCGImage(image, - fromRect: extent) - let output = UIImage(CGImage: _output) + from: extent) + let output = UIImage(cgImage: _output!) return output } - private func setValues(for filter: CIFilter, with _filter: T) { + fileprivate func setValues(for filter: CIFilter, with _filter: T) { let scanned = _filter.scanned() for (key, value) in scanned { guard let value = value as? AnyObject else { diff --git a/Source/ImageProcessor/Processor/ImageProcessorType.swift b/Source/ImageProcessor/Processor/ImageProcessorType.swift index a4d2862..3a882a5 100644 --- a/Source/ImageProcessor/Processor/ImageProcessorType.swift +++ b/Source/ImageProcessor/Processor/ImageProcessorType.swift @@ -9,5 +9,5 @@ import UIKit public protocol ImageProcessorType { - func process(image image: UIImage, filter: T, completion: (UIImage?) -> Void) + func process(image: UIImage, filter: T, completion: (UIImage?) -> Void) } diff --git a/Source/UI/.DS_Store b/Source/UI/.DS_Store new file mode 100644 index 0000000..efd177b Binary files /dev/null and b/Source/UI/.DS_Store differ diff --git a/Source/UI/ScalePicker.swift b/Source/UI/ScalePicker.swift index cddcf55..858f452 100644 --- a/Source/UI/ScalePicker.swift +++ b/Source/UI/ScalePicker.swift @@ -18,24 +18,24 @@ public final class ScalePicker: UIControl { @IBInspectable public var count: Int = 57 @IBInspectable public var scalar: Float = 1 @IBInspectable public var offset: Int = 4 - @IBInspectable public var tickColor: UIColor = UIColor.blueColor() + @IBInspectable public var tickColor: UIColor = UIColor.blue @IBInspectable public var distance: CGFloat = 32 public var initialValue: Float = 0 public var value: Float = 0 { didSet { - sendActionsForControlEvents(.ValueChanged) + sendActions(for: .valueChanged) } } - private var midItem: Int { + fileprivate var midItem: Int { return Int((count - 1) / 2) } - private var contentCenteredIndexPath: NSIndexPath? { - let filtered = collectionView.indexPathsForVisibleItems().filter { path in - guard let cell = collectionView.cellForItemAtIndexPath(path) else { + fileprivate var contentCenteredIndexPath: IndexPath? { + let filtered = collectionView.indexPathsForVisibleItems.filter { path in + guard let cell = collectionView.cellForItem(at: path) else { return false } @@ -45,46 +45,46 @@ public final class ScalePicker: UIControl { return filtered.last } - private var centeredIndexPath: NSIndexPath? { - guard let centered = contentCenteredIndexPath, cell = collectionView.cellForItemAtIndexPath(centered) else { + fileprivate var centeredIndexPath: IndexPath? { + guard let centered = contentCenteredIndexPath, let cell = collectionView.cellForItem(at: centered) else { return nil } let x = (cell.frame.midX - collectionView.contentOffset.x - collectionView.frame.width / 2) if x > 0 && centered.item > midItem { - return NSIndexPath(forItem: centered.item - 1, inSection: centered.section) + return IndexPath(item: centered.item - 1, section: centered.section) } else if x < 0 && centered.item < midItem { - return NSIndexPath(forItem: centered.item + 1, inSection: centered.section) + return IndexPath(item: centered.item + 1, section: centered.section) } else { return centered } } - private var maxX: CGFloat { - let indexPath = NSIndexPath(forItem: count - 1 - offset, inSection: 0) - if let cell = collectionView.cellForItemAtIndexPath(indexPath) { + fileprivate var maxX: CGFloat { + let indexPath = IndexPath(item: count - 1 - offset, section: 0) + if let cell = collectionView.cellForItem(at: indexPath) { return cell.frame.midX } else { return collectionView.contentSize.width } } - private var minX: CGFloat { - let indexPath = NSIndexPath(forItem: offset, inSection: 0) - if let cell = collectionView.cellForItemAtIndexPath(indexPath) { + fileprivate var minX: CGFloat { + let indexPath = IndexPath(item: offset, section: 0) + if let cell = collectionView.cellForItem(at: indexPath) { return cell.frame.midX } else { return 0 } } - private var midX: CGFloat { + fileprivate var midX: CGFloat { return collectionView.contentSize.width / 2 } - private lazy var collectionView: UICollectionView = { + fileprivate lazy var collectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() - layout.scrollDirection = .Horizontal + layout.scrollDirection = .horizontal let collectionView = UICollectionView(frame: self.bounds, collectionViewLayout: layout) return collectionView }() @@ -95,26 +95,26 @@ public final class ScalePicker: UIControl { addSubview(collectionView) collectionView.translatesAutoresizingMaskIntoConstraints = false - collectionView.backgroundColor = .clearColor() - collectionView.registerClass(Cell.self, forCellWithReuseIdentifier: Cell.identifier) + collectionView.backgroundColor = .clear + collectionView.register(Cell.self, forCellWithReuseIdentifier: Cell.identifier) collectionView.showsHorizontalScrollIndicator = false collectionView.dataSource = self collectionView.delegate = self let anchors = [ - collectionView.topAnchor.constraintEqualToAnchor(topAnchor), - collectionView.bottomAnchor.constraintEqualToAnchor(bottomAnchor), - collectionView.leadingAnchor.constraintEqualToAnchor(leadingAnchor), - collectionView.trailingAnchor.constraintEqualToAnchor(trailingAnchor) + collectionView.topAnchor.constraint(equalTo: topAnchor), + collectionView.bottomAnchor.constraint(equalTo: bottomAnchor), + collectionView.leadingAnchor.constraint(equalTo: leadingAnchor), + collectionView.trailingAnchor.constraint(equalTo: trailingAnchor) ].flatMap { $0 } - NSLayoutConstraint.activateConstraints(anchors) + NSLayoutConstraint.activate(anchors) reset() } - public override func drawRect(rect: CGRect) { + public override func draw(_ rect: CGRect) { let side: CGFloat = 5 let rect = CGRect( origin: @@ -125,30 +125,30 @@ public final class ScalePicker: UIControl { size: CGSize(width: side, height: side) ) - let circle = UIBezierPath(ovalInRect: rect) + let circle = UIBezierPath(ovalIn: rect) tickColor.set() circle.fill() } public func reset() { - let indexPath = NSIndexPath(forItem: Int((count - 1) / 2), inSection: 0) - collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .CenteredHorizontally, animated: false) + let indexPath = IndexPath(item: Int((count - 1) / 2), section: 0) + collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: false) } } extension ScalePicker: UICollectionViewDataSource, UICollectionViewDelegate { - public func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { + public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } - public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return count } - public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCellWithReuseIdentifier(Cell.identifier, forIndexPath: indexPath) as! Cell + public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Cell.identifier, for: indexPath) as! Cell cell.backgroundColor = tickColor cell.layer.cornerRadius = cell.frame.width / 2 @@ -159,27 +159,27 @@ extension ScalePicker: UICollectionViewDataSource, UICollectionViewDelegate { extension ScalePicker: UICollectionViewDelegateFlowLayout { - public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8) } - public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: 3, height: collectionView.frame.width / 7) } - public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat { + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return distance } - public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat { + public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return 1000 } } internal extension UICollectionView { - func indexPaths(for rect: CGRect) -> [NSIndexPath] { - guard let allLayoutAttributes = collectionViewLayout.layoutAttributesForElementsInRect(rect) else { + func indexPaths(for rect: CGRect) -> [IndexPath] { + guard let allLayoutAttributes = collectionViewLayout.layoutAttributesForElements(in: rect) else { return [] } @@ -194,12 +194,12 @@ internal extension UICollectionView { } extension ScalePicker { - public func scrollViewDidScroll(scrollView: UIScrollView) { + public func scrollViewDidScroll(_ scrollView: UIScrollView) { handleScroll(scrollView) - if let indexPath = centeredIndexPath, cell = collectionView.cellForItemAtIndexPath(indexPath) { - let mid = scrollView.convertPoint(cell.center, toView: self) + if let indexPath = centeredIndexPath, let cell = collectionView.cellForItem(at: indexPath) { + let mid = scrollView.convert(cell.center, to: self) let _d = (bounds.midX - mid.x) / distance let d = _d > 0 ? _d : (1 + _d) @@ -207,11 +207,11 @@ extension ScalePicker { } } - public func scrollViewWillBeginDecelerating(scrollView: UIScrollView) { + public func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) { handleScroll(scrollView) } - private func handleScroll(scrollView: UIScrollView) { + fileprivate func handleScroll(_ scrollView: UIScrollView) { var offset = scrollView.contentOffset if scrollView.contentOffset.x + scrollView.frame.width / 2 < minX { diff --git a/Source/UI/TwoSideSlider.swift b/Source/UI/TwoSideSlider.swift index ed71c55..21e055a 100644 --- a/Source/UI/TwoSideSlider.swift +++ b/Source/UI/TwoSideSlider.swift @@ -17,8 +17,8 @@ public final class TwoSideSlider: UIControl { @IBInspectable public var maxValue: CGFloat = 50 @IBInspectable public var lineWidth: CGFloat = 1 - @IBInspectable public var lineColor: UIColor = .blackColor() - @IBInspectable public var lineTintColor: UIColor = .redColor() + @IBInspectable public var lineColor: UIColor = .black + @IBInspectable public var lineTintColor: UIColor = .red @IBInspectable public var thumbImage: UIImage = UIImage() { didSet { @@ -27,7 +27,7 @@ public final class TwoSideSlider: UIControl { } @IBInspectable public var centerThickHeight: CGFloat = 8 - @IBInspectable public var centerThickColor: UIColor = .redColor() + @IBInspectable public var centerThickColor: UIColor = .red // MARK: Properties @@ -37,22 +37,22 @@ public final class TwoSideSlider: UIControl { didSet { label.text = "\(Int(currentValue))" adjustLabelPosition() - sendActionsForControlEvents(.ValueChanged) + sendActions(for: .valueChanged) } } - private let centerThickWidth: CGFloat = 1 + fileprivate let centerThickWidth: CGFloat = 1 - private lazy var line = CALayer() - private lazy var thick = CALayer() - private lazy var thumb = UIImageView() - private lazy var label = UILabel() + fileprivate lazy var line = CALayer() + fileprivate lazy var thick = CALayer() + fileprivate lazy var thumb = UIImageView() + fileprivate lazy var label = UILabel() - private lazy var leftLine = UIView() - private lazy var rightLine = UIView() + fileprivate lazy var leftLine = UIView() + fileprivate lazy var rightLine = UIView() - private var moving = false - private var previousPoint: CGPoint = .zero + fileprivate var moving = false + fileprivate var previousPoint: CGPoint = .zero // MARK: Life cycle @@ -60,17 +60,17 @@ public final class TwoSideSlider: UIControl { super.layoutSubviews() } - public override func drawRect(rect: CGRect) { + public override func draw(_ rect: CGRect) { guard !moving else { return } - backgroundColor = .clearColor() + backgroundColor = .clear layer.addSublayer(line) line.frame.origin = CGPoint(x: bounds.minX, y: bounds.midY - lineWidth / 2) line.frame.size = CGSize(width: bounds.width, height: lineWidth) - line.backgroundColor = lineColor.CGColor + line.backgroundColor = lineColor.cgColor line.cornerRadius = lineWidth / 2 addSubview(leftLine) @@ -88,7 +88,7 @@ public final class TwoSideSlider: UIControl { layer.addSublayer(thick) thick.position = CGPoint(x: bounds.midX - centerThickWidth / 2, y: bounds.midY - centerThickHeight / 2) thick.frame.size = CGSize(width: centerThickWidth, height: centerThickHeight) - thick.backgroundColor = centerThickColor.CGColor + thick.backgroundColor = centerThickColor.cgColor thick.cornerRadius = centerThickWidth / 2 addSubview(thumb) @@ -98,8 +98,8 @@ public final class TwoSideSlider: UIControl { addSubview(label) label.textColor = lineTintColor - label.textAlignment = .Center - label.font = UIFont.systemFontOfSize(13) + label.textAlignment = .center + label.font = UIFont.systemFont(ofSize: 13) label.text = "\(Int(midValue))" adjustLabelPosition() } @@ -121,37 +121,37 @@ public final class TwoSideSlider: UIControl { // MARK: IBActions - @IBAction internal func didRecognizePanGesture(recognizer: UIPanGestureRecognizer) { - let point = recognizer.locationInView(self) + @IBAction internal func didRecognizePanGesture(_ recognizer: UIPanGestureRecognizer) { + let point = recognizer.location(in: self) moving = true - guard recognizer.state != .Began else { + guard recognizer.state != .began else { previousPoint = point return } let delta = point.x - previousPoint.x previousPoint = point - moveThumb(dx: delta) + moveThumb(delta) - if recognizer.state == .Ended { + if recognizer.state == .ended { moving = false let distance = thumb.center.x - bounds.midX if abs(distance) <= 30 { currentValue = midValue resetLines() - UIView.animateWithDuration(0.2) { + UIView.animate(withDuration: 0.2, animations: { let bounds = self.bounds self.thumb.center = CGPoint(x: bounds.midX, y: bounds.midY) self.adjustLabelPosition() - } + }) } } } // MARK: UI movement - private func moveThumb(dx dx: CGFloat) { + fileprivate func moveThumb(_ dx: CGFloat) { var dx = dx if dx < 0 && thumb.frame.minX + dx < 0 { @@ -162,10 +162,10 @@ public final class TwoSideSlider: UIControl { thumb.frame.origin.x += dx adjustLabelPosition() - moveThickLine(dx: dx) + moveThickLine(dx) } - private func adjustLabelPosition() { + fileprivate func adjustLabelPosition() { label.sizeToFit() label.center = CGPoint(x: thumb.center.x, y: thumb.frame.minY - label.frame.height) if currentValue == midValue { @@ -175,9 +175,9 @@ public final class TwoSideSlider: UIControl { } } - private func moveThickLine(dx dx: CGFloat) { - moveLeftLine(dx: dx) - moveRightLine(dx: dx) + fileprivate func moveThickLine(_ dx: CGFloat) { + moveLeftLine(dx) + moveRightLine(dx) if thumb.center.x > bounds.midX { let x = thumb.center.x > bounds.midX * 1.5 ? // left or right side of right line @@ -194,7 +194,7 @@ public final class TwoSideSlider: UIControl { } } - private func moveLeftLine(dx dx: CGFloat) { + fileprivate func moveLeftLine(_ dx: CGFloat) { var dx = dx if dx < 0 { guard thumb.center.x < bounds.midX else { @@ -228,7 +228,7 @@ public final class TwoSideSlider: UIControl { } } - private func moveRightLine(dx dx: CGFloat) { + fileprivate func moveRightLine(_ dx: CGFloat) { var dx = dx if dx < 0 { if rightLine.frame.width > 0 { @@ -270,4 +270,4 @@ public final class TwoSideSlider: UIControl { resetLines() } -} \ No newline at end of file +}