Skip to content

Commit

Permalink
Merge pull request #251 from ruslanskorb/develop
Browse files Browse the repository at this point in the history
Version 4.1.0
  • Loading branch information
ruslanskorb authored Apr 8, 2024
2 parents 36c6289 + 7a7d096 commit 1717c49
Show file tree
Hide file tree
Showing 56 changed files with 475 additions and 190 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
workflow_dispatch:
jobs:
iOS:
runs-on: macos-12
runs-on: macos-13
env:
DEVELOPER_DIR: '/Applications/Xcode_13.4.app/Contents/Developer'
DEVELOPER_DIR: '/Applications/Xcode_15.0.1.app/Contents/Developer'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: Example/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: e2296c0f63c75329f0583a4252b3dfcb582ff009

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
32 changes: 16 additions & 16 deletions Example/RSKImageCropperExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
B8D73A871B9B1E73003AFA4A /* RSKInternalUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = B8D73A861B9B1E73003AFA4A /* RSKInternalUtility.m */; };
B8F617661AE43CEF00499402 /* RSKImageCropperPerformanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F617651AE43CEF00499402 /* RSKImageCropperPerformanceTests.m */; };
B8F617681AE4468000499402 /* RSKImageScrollViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F617671AE4468000499402 /* RSKImageScrollViewTests.m */; };
ED6AB2167F8AE24BA43C7555 /* libPods-RSKImageCropperExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F1D7827AE01F17D6196BBEC0 /* libPods-RSKImageCropperExampleTests.a */; };
D6C4891228B0D5D4681BB50D /* libPods-RSKImageCropperExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2161A88867D09281BCE7A079 /* libPods-RSKImageCropperExampleTests.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -45,7 +45,10 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
01A71E3D794357135D4C815F /* Pods-RSKImageCropperExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RSKImageCropperExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-RSKImageCropperExampleTests/Pods-RSKImageCropperExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
2161A88867D09281BCE7A079 /* libPods-RSKImageCropperExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RSKImageCropperExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
46AAEE5D1B29155700E10C42 /* RSKImageCropViewController+Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RSKImageCropViewController+Protected.h"; sourceTree = "<group>"; };
996086E4617CD3436300F4E4 /* Pods-RSKImageCropperExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RSKImageCropperExampleTests.release.xcconfig"; path = "Target Support Files/Pods-RSKImageCropperExampleTests/Pods-RSKImageCropperExampleTests.release.xcconfig"; sourceTree = "<group>"; };
B803F69C1AAB0A1F004141CF /* CGGeometry+RSKImageCropper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CGGeometry+RSKImageCropper.h"; sourceTree = "<group>"; };
B803F69D1AAB0A1F004141CF /* CGGeometry+RSKImageCropper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CGGeometry+RSKImageCropper.m"; sourceTree = "<group>"; };
B8182F2D1ABC998B00601E43 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -84,9 +87,6 @@
B8D73A861B9B1E73003AFA4A /* RSKInternalUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSKInternalUtility.m; sourceTree = "<group>"; };
B8F617651AE43CEF00499402 /* RSKImageCropperPerformanceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSKImageCropperPerformanceTests.m; sourceTree = "<group>"; };
B8F617671AE4468000499402 /* RSKImageScrollViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSKImageScrollViewTests.m; sourceTree = "<group>"; };
E6FAA073685BE5E78305A11F /* Pods-RSKImageCropperExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RSKImageCropperExampleTests.release.xcconfig"; path = "Target Support Files/Pods-RSKImageCropperExampleTests/Pods-RSKImageCropperExampleTests.release.xcconfig"; sourceTree = "<group>"; };
F1D7827AE01F17D6196BBEC0 /* libPods-RSKImageCropperExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RSKImageCropperExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FB8BD8ED2909E82D44808408 /* Pods-RSKImageCropperExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RSKImageCropperExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-RSKImageCropperExampleTests/Pods-RSKImageCropperExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -107,7 +107,7 @@
B87A9A0919A4D2CD00D12CD4 /* XCTest.framework in Frameworks */,
B87A9A0B19A4D2CD00D12CD4 /* UIKit.framework in Frameworks */,
B87A9A0A19A4D2CD00D12CD4 /* Foundation.framework in Frameworks */,
ED6AB2167F8AE24BA43C7555 /* libPods-RSKImageCropperExampleTests.a in Frameworks */,
D6C4891228B0D5D4681BB50D /* libPods-RSKImageCropperExampleTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -117,8 +117,8 @@
45354A06E09E0095C4070E12 /* Pods */ = {
isa = PBXGroup;
children = (
FB8BD8ED2909E82D44808408 /* Pods-RSKImageCropperExampleTests.debug.xcconfig */,
E6FAA073685BE5E78305A11F /* Pods-RSKImageCropperExampleTests.release.xcconfig */,
01A71E3D794357135D4C815F /* Pods-RSKImageCropperExampleTests.debug.xcconfig */,
996086E4617CD3436300F4E4 /* Pods-RSKImageCropperExampleTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -151,7 +151,7 @@
B87A99F119A4D2CD00D12CD4 /* CoreGraphics.framework */,
B87A99F319A4D2CD00D12CD4 /* UIKit.framework */,
B87A9A0819A4D2CD00D12CD4 /* XCTest.framework */,
F1D7827AE01F17D6196BBEC0 /* libPods-RSKImageCropperExampleTests.a */,
2161A88867D09281BCE7A079 /* libPods-RSKImageCropperExampleTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -276,7 +276,7 @@
isa = PBXNativeTarget;
buildConfigurationList = B87A9A1B19A4D2CD00D12CD4 /* Build configuration list for PBXNativeTarget "RSKImageCropperExampleTests" */;
buildPhases = (
60073F70E21CEB41C716D9E9 /* [CP] Check Pods Manifest.lock */,
E80ED87158857BE8135460A8 /* [CP] Check Pods Manifest.lock */,
B87A9A0319A4D2CD00D12CD4 /* Sources */,
B87A9A0419A4D2CD00D12CD4 /* Frameworks */,
B87A9A0519A4D2CD00D12CD4 /* Resources */,
Expand Down Expand Up @@ -352,7 +352,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
60073F70E21CEB41C716D9E9 /* [CP] Check Pods Manifest.lock */ = {
E80ED87158857BE8135460A8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -555,12 +555,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = J3P7YV7464;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RSKImageCropperExample/RSKImageCropperExample-Prefix.pch";
INFOPLIST_FILE = "RSKImageCropperExample/RSKImageCropperExample-Info.plist";
MARKETING_VERSION = 4.0.0;
MARKETING_VERSION = 4.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = RSKImageCropperExample;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -572,12 +572,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = J3P7YV7464;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RSKImageCropperExample/RSKImageCropperExample-Prefix.pch";
INFOPLIST_FILE = "RSKImageCropperExample/RSKImageCropperExample-Info.plist";
MARKETING_VERSION = 4.0.0;
MARKETING_VERSION = 4.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = RSKImageCropperExample;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -587,7 +587,7 @@
};
B87A9A1C19A4D2CD00D12CD4 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FB8BD8ED2909E82D44808408 /* Pods-RSKImageCropperExampleTests.debug.xcconfig */;
baseConfigurationReference = 01A71E3D794357135D4C815F /* Pods-RSKImageCropperExampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RSKImageCropperExample.app/RSKImageCropperExample";
DEVELOPMENT_TEAM = J3P7YV7464;
Expand All @@ -611,7 +611,7 @@
};
B87A9A1D19A4D2CD00D12CD4 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E6FAA073685BE5E78305A11F /* Pods-RSKImageCropperExampleTests.release.xcconfig */;
baseConfigurationReference = 996086E4617CD3436300F4E4 /* Pods-RSKImageCropperExampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RSKImageCropperExample.app/RSKImageCropperExample";
DEVELOPMENT_TEAM = J3P7YV7464;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ - (CGRect)imageCropViewControllerCustomMaskRect:(RSKImageCropViewController *)co
CGFloat viewWidth = CGRectGetWidth(controller.view.frame);
CGFloat viewHeight = CGRectGetHeight(controller.view.frame);

CGRect maskRect = CGRectMake((viewWidth - maskSize.width) * 0.5f,
(viewHeight - maskSize.height) * 0.5f,
CGRect maskRect = CGRectMake(floor((viewWidth - maskSize.width) * 0.5f),
floor((viewHeight - maskSize.height) * 0.5f),
maskSize.width,
maskSize.height);

Expand Down Expand Up @@ -147,8 +147,8 @@ - (void)resetZoomScale;
[imageCropViewController.view setNeedsLayout];
[imageCropViewController.view layoutIfNeeded];

[imageCropViewController viewWillAppear:YES];
[imageCropViewController viewDidAppear:YES];
[imageCropViewController beginAppearanceTransition:YES animated:YES];
[imageCropViewController endAppearanceTransition];
};

beforeAll(^{
Expand Down Expand Up @@ -815,9 +815,11 @@ - (void)resetZoomScale;
[[mock expect] setNavigationBarHidden:YES animated:NO];

[imageCropViewController view];
[imageCropViewController viewWillAppear:NO];
[imageCropViewController beginAppearanceTransition:YES animated:NO];

[mock verify];

[imageCropViewController endAppearanceTransition];
});

it(@"restores visibility of the navigation bar in viewWillDisappear:", ^{
Expand All @@ -827,13 +829,16 @@ - (void)resetZoomScale;
id mock = [OCMockObject partialMockForObject:navigationController];

[imageCropViewController view];
[imageCropViewController viewWillAppear:NO];
[imageCropViewController beginAppearanceTransition:YES animated:NO];
[imageCropViewController endAppearanceTransition];

[[mock expect] setNavigationBarHidden:imageCropViewController.originalNavigationControllerNavigationBarHidden animated:NO];

[imageCropViewController viewWillDisappear:NO];
[imageCropViewController beginAppearanceTransition:NO animated:NO];

[mock verify];

[imageCropViewController endAppearanceTransition];
});

after(^{
Expand Down Expand Up @@ -990,6 +995,7 @@ - (void)resetZoomScale;

sharedIt();

imageCropViewController.imageScrollView.transform = CGAffineTransformIdentity;
expect(imageCropViewController.imageScrollView.frame).after(kLayoutImageScrollViewAnimationDuration).to.equal(imageCropViewController.maskRect);
});

Expand All @@ -998,6 +1004,7 @@ - (void)resetZoomScale;

sharedIt();

imageCropViewController.imageScrollView.transform = CGAffineTransformIdentity;
expect(imageCropViewController.imageScrollView.frame).after(kLayoutImageScrollViewAnimationDuration).to.equal(imageCropViewController.maskRect);
});

Expand Down Expand Up @@ -1076,17 +1083,10 @@ - (void)resetZoomScale;
});

it(@"zooms to a specific area of the image", ^{
CGRect rect = CGRectMake(100.0, 100.0, 400.0, 400.0);
CGRect rect = CGRectMake(196.0f, 290.0f, 60.0f, 60.0f);
[imageCropViewController zoomToRect:rect animated:NO];

UIScrollView *imageScrollView = imageCropViewController.imageScrollView;
CGRect visibleRect = CGRectMake(round(imageScrollView.contentOffset.x / imageScrollView.zoomScale),
round(imageScrollView.contentOffset.y / imageScrollView.zoomScale),
imageScrollView.bounds.size.width / imageScrollView.zoomScale,
imageScrollView.bounds.size.height / imageScrollView.zoomScale);

BOOL contains = CGRectContainsRect(visibleRect, rect);
expect(contains).to.beTruthy();
expect(imageCropViewController.view).to.haveValidSnapshot();
});

after(^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ - (void)setUp
[self.imageCropViewController.view updateConstraintsIfNeeded];
[self.imageCropViewController.view setNeedsLayout];
[self.imageCropViewController.view layoutIfNeeded];
[self.imageCropViewController viewWillAppear:NO];
[self.imageCropViewController viewDidAppear:NO];
[self.imageCropViewController beginAppearanceTransition:YES animated:NO];
[self.imageCropViewController endAppearanceTransition];
}

- (void)tearDown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__block UIImage *image = nil;

dispatch_block_t sharedIt = ^{
[imageScrollView displayImage:image];
imageScrollView.image = image;

[imageScrollView setNeedsLayout];
[imageScrollView layoutIfNeeded];
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ...eCropViewControllerSpec/[email protected]
Binary file modified ...mages/RSKImageScrollViewSpec/[email protected]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'cocoapods', '1.11.3'
gem 'cocoapods', '1.15.2'

gem 'fui', '0.5.0'
gem 'xcpretty', '0.3.0'
Loading

0 comments on commit 1717c49

Please sign in to comment.