Skip to content

Commit

Permalink
Fixed transition bug and reverted iOS 9 fix. (Need a better solution)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOliver committed Jun 15, 2015
1 parent 4ae4da7 commit f64c4fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
15 changes: 2 additions & 13 deletions TOCropViewController/TOCropViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ - (void)viewDidLayoutSubviews
self.cropView.frame = frame;
}

[UIView setAnimationsEnabled:NO];
self.toolbar.frame = [self frameForToolBarWithVerticalLayout:verticalLayout];
[self.toolbar setNeedsLayout];
[UIView setAnimationsEnabled:YES];
}

#pragma mark - Rotation Handling -
Expand All @@ -219,11 +217,11 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrie

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
self.toolbar.frame = [self frameForToolBarWithVerticalLayout:UIInterfaceOrientationIsLandscape(toInterfaceOrientation)];

[UIView animateWithDuration:duration animations:^{
self.snapshotView.alpha = 0.0f;
self.toolbar.alpha = 1.0f;

self.toolbar.frame = [self frameForToolBarWithVerticalLayout:UIInterfaceOrientationIsLandscape(toInterfaceOrientation)];
}];
[self.cropView performRelayoutForRotation];
}
Expand All @@ -236,15 +234,6 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO
[self.cropView setSimpleMode:NO animated:YES];
}

/*- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(nonnull id<UIViewControllerTransitionCoordinator>)coordinator
{
[coordinator animateAlongsideTransition:^(id context) {
}completion:^(id context) {
}];
}*/

#pragma mark - Reset -
- (void)resetCropViewLayout
{
Expand Down
6 changes: 6 additions & 0 deletions TOCropViewController/Views/TOCropView.m
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,18 @@ - (void)setCropElementsHidden:(BOOL)cropElementsHidden

- (void)setGridOverlayHidden:(BOOL)gridOverlayHidden
{
if (_gridOverlayHidden == gridOverlayHidden)
return;

_gridOverlayHidden = gridOverlayHidden;
[self setGridOverlayHidden:_gridOverlayHidden animated:NO];
}

- (void)setGridOverlayHidden:(BOOL)gridOverlayHidden animated:(BOOL)animated
{
if (_gridOverlayHidden == gridOverlayHidden)
return;

self.gridOverlayView.alpha = gridOverlayHidden ? 1.0f : 0.0f;

[UIView animateWithDuration:0.4f animations:^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<key>IDESourceControlProjectIdentifier</key>
<string>2D90AB17-71D2-4E13-9F5B-7AFB673BBD9E</string>
<key>IDESourceControlProjectName</key>
<string>TOCropViewControllerExample</string>
<string>project</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>EBF9236F7ED7963EA21B6A80B0DA4EDCCFA2B7DF</key>
<string>https://github.com/TimOliver/TOCropViewController.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>TOCropViewControllerExample.xcodeproj</string>
<string>TOCropViewControllerExample.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>EBF9236F7ED7963EA21B6A80B0DA4EDCCFA2B7DF</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TOCropViewController/TOCropViewController.m"
timestampString = "456024999.41819"
timestampString = "456039346.989192"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "212"
endingLineNumber = "212"
startingLineNumber = "210"
endingLineNumber = "210"
landmarkName = "-willRotateToInterfaceOrientation:duration:"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -26,11 +26,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TOCropViewController/TOCropViewController.m"
timestampString = "456024999.41819"
timestampString = "456039346.989192"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "193"
endingLineNumber = "193"
startingLineNumber = "192"
endingLineNumber = "192"
landmarkName = "-viewDidLayoutSubviews"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -42,11 +42,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TOCropViewController/TOCropViewController.m"
timestampString = "456024999.41819"
timestampString = "456039346.989192"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "201"
endingLineNumber = "201"
startingLineNumber = "199"
endingLineNumber = "199"
landmarkName = "-willRotateToInterfaceOrientation:duration:"
landmarkType = "5">
</BreakpointContent>
Expand Down

0 comments on commit f64c4fe

Please sign in to comment.