Skip to content

Commit

Permalink
Merge pull request #145 from NYTimes/feature/fix-tabs-add-115-comment
Browse files Browse the repository at this point in the history
Fix the use of tabs and add a comment explaining a workaround for #115
  • Loading branch information
cdzombak committed Jan 26, 2016
2 parents 478df24 + fc64303 commit 3e863f3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions Pod/Classes/ios/NYTPhotoTransitionAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,30 +224,30 @@ + (UIView *)newAnimationViewFromView:(UIView *)view {
if (!view) {
return nil;
}

UIView *animationView;

if (view.layer.contents) {
if ([view isKindOfClass:[UIImageView class]]) {
// The case of UIImageView is handled separately since the mere layer's contents (i.e. CGImage in this case) doesn't
// seem to contain proper informations about the image orientation for portrait images taken directly on the device.
animationView = [(UIImageView *)[[view class] alloc] initWithImage:((UIImageView *)view).image];
animationView.bounds = view.bounds;
}
else {
animationView = [[UIView alloc] initWithFrame:view.frame];
animationView.layer.contents = view.layer.contents;
animationView.layer.bounds = view.layer.bounds;
}

animationView.layer.cornerRadius = view.layer.cornerRadius;
animationView.layer.masksToBounds = view.layer.masksToBounds;
animationView.contentMode = view.contentMode;
animationView.transform = view.transform;
}
else {
animationView = [view snapshotViewAfterScreenUpdates:YES];
}
if (view.layer.contents) {
if ([view isKindOfClass:[UIImageView class]]) {
// The case of UIImageView is handled separately since the mere layer's contents (i.e. CGImage in this case) doesn't
// seem to contain proper informations about the image orientation for portrait images taken directly on the device.
// See https://github.com/NYTimes/NYTPhotoViewer/issues/115
animationView = [(UIImageView *)[[view class] alloc] initWithImage:((UIImageView *)view).image];
animationView.bounds = view.bounds;
}
else {
animationView = [[UIView alloc] initWithFrame:view.frame];
animationView.layer.contents = view.layer.contents;
animationView.layer.bounds = view.layer.bounds;
}

animationView.layer.cornerRadius = view.layer.cornerRadius;
animationView.layer.masksToBounds = view.layer.masksToBounds;
animationView.contentMode = view.contentMode;
animationView.transform = view.transform;
}
else {
animationView = [view snapshotViewAfterScreenUpdates:YES];
}

return animationView;
}
Expand Down

0 comments on commit 3e863f3

Please sign in to comment.