Skip to content

Commit

Permalink
Merge pull request #53 from ruslanskorb/develop
Browse files Browse the repository at this point in the history
Version bump (1.1.5)
  • Loading branch information
ruslanskorb committed May 27, 2015
2 parents a5709d2 + 541b154 commit 1b810ed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,18 @@ - (void)resetZoomScale;
});

it(@"displays new original image", ^{
id mock = [OCMockObject partialMockForObject:imageCropViewController];
[[mock expect] displayImage];
id mockImageCropViewControllerView = [OCMockObject partialMockForObject:imageCropViewController.view];
[[[mockImageCropViewControllerView stub] andReturn:[[UIWindow alloc] init]] window];

id mockImageCropViewController = [OCMockObject partialMockForObject:imageCropViewController];
[[[mockImageCropViewController stub] andReturn:mockImageCropViewControllerView] view];
[[mockImageCropViewController expect] displayImage];

imageCropViewController.originalImage = [UIImage imageNamed:@"photo"];

[mock verify];
[mock stopMocking];
[mockImageCropViewController verify];
[mockImageCropViewController stopMocking];
[mockImageCropViewControllerView stopMocking];
});

after(^{
Expand Down
2 changes: 1 addition & 1 deletion RSKImageCropper.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RSKImageCropper'
s.version = '1.1.3'
s.version = '1.1.5'
s.summary = 'An image cropper for iOS like in the Contacts app with support for landscape orientation.'
s.homepage = 'https://github.com/ruslanskorb/RSKImageCropper'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
9 changes: 7 additions & 2 deletions RSKImageCropper/RSKImageCropViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@

@interface RSKImageCropViewController () <UIGestureRecognizerDelegate>

@property (strong, nonatomic) UIColor *originalNavigationControllerViewBackgroundColor;
@property (assign, nonatomic) BOOL originalNavigationControllerNavigationBarHidden;
@property (strong, nonatomic) UIImage *originalNavigationControllerNavigationBarShadowImage;
@property (strong, nonatomic) UIColor *originalNavigationControllerViewBackgroundColor;
@property (assign, nonatomic) BOOL originalStatusBarHidden;

@property (strong, nonatomic) RSKImageScrollView *imageScrollView;
Expand Down Expand Up @@ -141,6 +142,9 @@ - (void)viewWillAppear:(BOOL)animated

self.originalNavigationControllerNavigationBarHidden = self.navigationController.navigationBarHidden;
[self.navigationController setNavigationBarHidden:YES animated:NO];

self.originalNavigationControllerNavigationBarShadowImage = self.navigationController.navigationBar.shadowImage;
self.navigationController.navigationBar.shadowImage = nil;
}

- (void)viewDidAppear:(BOOL)animated
Expand All @@ -161,6 +165,7 @@ - (void)viewWillDisappear:(BOOL)animated
}

[self.navigationController setNavigationBarHidden:self.originalNavigationControllerNavigationBarHidden animated:animated];
self.navigationController.navigationBar.shadowImage = self.originalNavigationControllerNavigationBarShadowImage;
self.navigationController.view.backgroundColor = self.originalNavigationControllerViewBackgroundColor;
}

Expand Down Expand Up @@ -398,7 +403,7 @@ - (void)setOriginalImage:(UIImage *)originalImage
{
if (![_originalImage isEqual:originalImage]) {
_originalImage = originalImage;
if (self.isViewLoaded) {
if (self.isViewLoaded && self.view.window) {
[self displayImage];
}
}
Expand Down

0 comments on commit 1b810ed

Please sign in to comment.