Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroalonso committed Jun 29, 2020
2 parents 1b158af + 4e066b1 commit 4add829
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Nimble" "v8.0.7"
github "TimOliver/TOCropViewController" "2.5.2"
github "TimOliver/TOCropViewController" "2.5.3"
4 changes: 2 additions & 2 deletions MediaEditor.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MediaEditor'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'An extensible Media Editor for iOS.'

s.description = <<-DESC
Expand All @@ -22,5 +22,5 @@ Pod::Spec.new do |s|
'MediaEditor' => 'Sources/**/*.{xcassets}'
}

s.dependency 'TOCropViewController', '~> 2.5.2'
s.dependency 'CropViewController', '~> 2.5.3'
end
8 changes: 4 additions & 4 deletions MediaEditor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
8B5046AC23D7C9AD00068F66 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8B5046AF23D7C9AD00068F66 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8B5046B123D7C9AD00068F66 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8B5046B723D7CCBD00068F66 /* TOCropViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TOCropViewController.framework; path = Carthage/Build/iOS/TOCropViewController.framework; sourceTree = "<group>"; };
8B5046B723D7CCBD00068F66 /* CropViewController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CropViewController.framework; path = Carthage/Build/iOS/CropViewController.framework; sourceTree = "<group>"; };
8B5046C423D7CE1600068F66 /* UIImage+AsyncImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+AsyncImage.swift"; sourceTree = "<group>"; };
8B5046C523D7CE1600068F66 /* PHAsset+AsyncImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PHAsset+AsyncImage.swift"; sourceTree = "<group>"; };
8B5046C623D7CE1600068F66 /* MediaEditor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaEditor.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -156,15 +156,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8B5046BB23D7CCD000068F66 /* TOCropViewController.framework in Frameworks */,
8B5046BB23D7CCD000068F66 /* CropViewController.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8B50469E23D7C9AC00068F66 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8B5046B823D7CCBD00068F66 /* TOCropViewController.framework in Frameworks */,
8B5046B823D7CCBD00068F66 /* CropViewController.framework in Frameworks */,
8B5046B623D7C9E300068F66 /* MediaEditor.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -346,7 +346,7 @@
isa = PBXGroup;
children = (
8B5046FC23D7D16A00068F66 /* Nimble.framework */,
8B5046B723D7CCBD00068F66 /* TOCropViewController.framework */,
8B5046B723D7CCBD00068F66 /* CropViewController.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ github "wordpress-mobile/MediaEditor-iOS"

2. Run `carthage update`

3. From the `Carthage/Build` folder, import `MediaEditor.framework` and `TOCropViewController.framework` into your Xcode project.
3. From the `Carthage/Build` folder, import `MediaEditor.framework` and `CropViewController.framework` into your Xcode project.

4. Follow the remaining steps on [Getting Started with Carthage](https://github.com/Carthage/Carthage#getting-started) to finish integrating the framework.

Expand Down
4 changes: 4 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.2.0
-----
* Replace TOCropViewController with CropViewController

1.1.0
-----
* Add Drawing capability using PencilKit
Expand Down
8 changes: 4 additions & 4 deletions Sources/Capabilities/Crop/MediaEditorCropZoomRotate.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import UIKit
import TOCropViewController
import CropViewController

typealias MediaEditorCropZoomRotate = TOCropViewController
typealias MediaEditorCropZoomRotate = CropViewController

extension TOCropViewController: MediaEditorCapability {
extension CropViewController: MediaEditorCapability {
public static var name = "Crop, Zoom, Rotate"

public static var icon = UIImage(named: "gridicons-crop", in: .mediaEditor, compatibleWith: nil)!

public static func initialize(_ image: UIImage, onFinishEditing: @escaping (UIImage, [MediaEditorOperation]) -> (), onCancel: @escaping () -> ()) -> CapabilityViewController {
let cropViewController = TOCropViewController(image: image)
let cropViewController = CropViewController(image: image)

weak var toCrop = cropViewController

Expand Down
6 changes: 3 additions & 3 deletions Sources/Capabilities/Crop/TOCropViewController+Ext.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TOCropViewController
import CropViewController

extension TOCropViewController {
// TOCropViewController sometimes resize the image by 1, 2 or 3 points automatically.
extension CropViewController {
// CropViewController sometimes resize the image by 1, 2 or 3 points automatically.
// In those cases we're not considering that as a cropping action.
var isCropped: Bool {
return abs(imageSizeDiscardingRotation.width - image.size.width) > 4 ||
Expand Down
10 changes: 5 additions & 5 deletions Tests/Capabilities/Crop/MediaEditorCropZoomRotateTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
import TOCropViewController
import CropViewController
import Nimble

@testable import MediaEditor
Expand All @@ -17,7 +17,7 @@ class MediaEditorCropZoomRotateTests: XCTestCase {
func testDoNotHideNavigation() {
let mediaEditorCrop = MediaEditorCropZoomRotate.initialize(image, onFinishEditing: { _, _ in }, onCancel: {})

let viewController = mediaEditorCrop as? TOCropViewController
let viewController = mediaEditorCrop as? CropViewController

expect(viewController?.hidesNavigationBar).to(beFalse())
}
Expand All @@ -30,7 +30,7 @@ class MediaEditorCropZoomRotateTests: XCTestCase {
onFinishEditingCalled = true
},
onCancel: {})
let viewController = mediaEditorCrop as? TOCropViewController
let viewController = mediaEditorCrop as? CropViewController

viewController?.onDidCropToRect?(image, .zero, 0)

Expand All @@ -46,7 +46,7 @@ class MediaEditorCropZoomRotateTests: XCTestCase {
onCancelCalled = true
}
)
let viewController = mediaEditorCrop as? TOCropViewController
let viewController = mediaEditorCrop as? CropViewController

viewController?.onDidFinishCancelled?(true)

Expand All @@ -58,7 +58,7 @@ class MediaEditorCropZoomRotateTests: XCTestCase {

mediaEditorCrop.apply(styles: [.rotateCounterclockwiseButtonHidden: true])

let viewController = mediaEditorCrop as? TOCropViewController
let viewController = mediaEditorCrop as? CropViewController
expect(viewController?.toolbar.rotateCounterclockwiseButtonHidden).to(beTrue())
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/MediaEditorTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
import TOCropViewController
import CropViewController
import Nimble

@testable import MediaEditor
Expand Down

0 comments on commit 4add829

Please sign in to comment.