From 4eb2ed3edf7e639d58afa5c8ea5c8f32400c78a1 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 20 Mar 2017 17:25:10 +0300 Subject: [PATCH] [MAPSME-4096] Review fixes. --- .../Maps/Categories/UIView+Coordinates.swift | 2 +- iphone/Maps/Maps.xcodeproj/project.pbxproj | 16 +++++----- .../PlacePage/MWMPlacePageButtonsProtocol.h | 4 ++- .../Maps/UI/PlacePage/MWMPlacePageManager.mm | 12 +++----- ...ImageView.swift => PhotoScalingView.swift} | 4 +-- .../Gallery/Photos/PhotoViewController.swift | 30 +++++++++---------- .../Photos/PhotosInteractionAnimator.swift | 20 +++++-------- .../Photos/PhotosTransitionAnimator.swift | 12 ++++---- .../Gallery/Photos/PhotosViewController.swift | 4 +-- 9 files changed, 49 insertions(+), 55 deletions(-) rename iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/{PhotoScalingImageView.swift => PhotoScalingView.swift} (96%) diff --git a/iphone/Maps/Categories/UIView+Coordinates.swift b/iphone/Maps/Categories/UIView+Coordinates.swift index 41aec39329..57a42cae7b 100644 --- a/iphone/Maps/Categories/UIView+Coordinates.swift +++ b/iphone/Maps/Categories/UIView+Coordinates.swift @@ -2,7 +2,7 @@ import UIKit extension UIView { func center(inContainerView containerView: UIView) -> CGPoint { - guard let sv = superview else { return CGPoint.zero } + guard let sv = superview else { return .zero } var centerPoint = center if let scrollView = sv as? UIScrollView , scrollView.zoomScale != 1.0 { diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 5604e18eb9..ecf9061513 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -24,9 +24,9 @@ 3404164F1E7C085F00E2B6D6 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3404164E1E7C085F00E2B6D6 /* PhotoViewController.swift */; }; 340416501E7C086000E2B6D6 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3404164E1E7C085F00E2B6D6 /* PhotoViewController.swift */; }; 340416511E7C086000E2B6D6 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3404164E1E7C085F00E2B6D6 /* PhotoViewController.swift */; }; - 340416531E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingImageView.swift */; }; - 340416541E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingImageView.swift */; }; - 340416551E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingImageView.swift */; }; + 340416531E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingView.swift */; }; + 340416541E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingView.swift */; }; + 340416551E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416521E7C09C200E2B6D6 /* PhotoScalingView.swift */; }; 340416571E7C0D4100E2B6D6 /* PhotosOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416561E7C0D4100E2B6D6 /* PhotosOverlayView.swift */; }; 340416581E7C0D4100E2B6D6 /* PhotosOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416561E7C0D4100E2B6D6 /* PhotosOverlayView.swift */; }; 340416591E7C0D4100E2B6D6 /* PhotosOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416561E7C0D4100E2B6D6 /* PhotosOverlayView.swift */; }; @@ -1479,7 +1479,7 @@ 340416461E7BF28E00E2B6D6 /* UIView+Snapshot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Snapshot.swift"; sourceTree = ""; }; 3404164A1E7BF42D00E2B6D6 /* UIView+Coordinates.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Coordinates.swift"; sourceTree = ""; }; 3404164E1E7C085F00E2B6D6 /* PhotoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = ""; }; - 340416521E7C09C200E2B6D6 /* PhotoScalingImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoScalingImageView.swift; sourceTree = ""; }; + 340416521E7C09C200E2B6D6 /* PhotoScalingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoScalingView.swift; sourceTree = ""; }; 340416561E7C0D4100E2B6D6 /* PhotosOverlayView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosOverlayView.swift; sourceTree = ""; }; 3404165A1E7C29AE00E2B6D6 /* PhotosInteractionAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosInteractionAnimator.swift; sourceTree = ""; }; 340474DC1E08199D00C92850 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; @@ -2539,7 +2539,7 @@ 340416391E7BDFB800E2B6D6 /* Photos */ = { isa = PBXGroup; children = ( - 340416521E7C09C200E2B6D6 /* PhotoScalingImageView.swift */, + 340416521E7C09C200E2B6D6 /* PhotoScalingView.swift */, 3404165A1E7C29AE00E2B6D6 /* PhotosInteractionAnimator.swift */, 340416561E7C0D4100E2B6D6 /* PhotosOverlayView.swift */, 340416421E7BED3900E2B6D6 /* PhotosTransitionAnimator.swift */, @@ -5088,7 +5088,7 @@ F6E2FE9F1E097BA00083EBEC /* MWMPlacePageLayout.mm in Sources */, F6E2FEC31E097BA00083EBEC /* MWMSearchFilterPresentationController.mm in Sources */, 340475731E081A4600C92850 /* MWMStorage.mm in Sources */, - 340416531E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */, + 340416531E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */, F6E2FD851E097BA00083EBEC /* MWMBaseMapDownloaderViewController.mm in Sources */, 34ABA6241C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, 34943BBA1E2626B200B14F84 /* WelcomePageController.swift in Sources */, @@ -5368,7 +5368,7 @@ F6E2FF301E097BA00083EBEC /* MWMSearchCommonCell.mm in Sources */, F6E2FEA01E097BA00083EBEC /* MWMPlacePageLayout.mm in Sources */, F6E2FEC41E097BA00083EBEC /* MWMSearchFilterPresentationController.mm in Sources */, - 340416541E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */, + 340416541E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */, 34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, F6E2FD861E097BA00083EBEC /* MWMBaseMapDownloaderViewController.mm in Sources */, F6E2FEE21E097BA00083EBEC /* MWMSearchManager.mm in Sources */, @@ -5648,7 +5648,7 @@ F6E2FEA11E097BA00083EBEC /* MWMPlacePageLayout.mm in Sources */, F6E2FEC51E097BA00083EBEC /* MWMSearchFilterPresentationController.mm in Sources */, F6E2FD871E097BA00083EBEC /* MWMBaseMapDownloaderViewController.mm in Sources */, - 340416551E7C09C200E2B6D6 /* PhotoScalingImageView.swift in Sources */, + 340416551E7C09C200E2B6D6 /* PhotoScalingView.swift in Sources */, F6E2FEE31E097BA00083EBEC /* MWMSearchManager.mm in Sources */, 34943BBC1E2626B200B14F84 /* WelcomePageController.swift in Sources */, F6E2FE231E097BA00083EBEC /* MWMOpeningHoursEditorViewController.mm in Sources */, diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h index dd63225ecc..5894fc5606 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h @@ -1,3 +1,5 @@ +typedef UIView * (^MWMPlacePageButtonsDismissBlock)(NSInteger); + @protocol MWMPlacePageButtonsProtocol - (void)editPlace; @@ -10,7 +12,7 @@ - (void)showAllFacilities; - (void)showPhotoAtIndex:(NSInteger)index referenceView:(UIView *)referenceView - referenceViewWhenDismissingHandler:(UIView * (^)(NSInteger))referenceViewWhenDismissingHandler; + referenceViewWhenDismissingHandler:(MWMPlacePageButtonsDismissBlock)referenceViewWhenDismissingHandler; - (void)showGalery; @end diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index caaaca0f99..b87a33ce6f 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -313,10 +313,10 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) - (void)showPhotoAtIndex:(NSInteger)index referenceView:(UIView *)referenceView - referenceViewWhenDismissingHandler:(UIView * (^)(NSInteger))referenceViewWhenDismissingHandler + referenceViewWhenDismissingHandler:(MWMPlacePageButtonsDismissBlock)referenceViewWhenDismissingHandler { logSponsoredEvent(self.data, kPlacePageHotelGallery); - auto galleryModel = self.galleryModel; + auto galleryModel = [[MWMGalleryModel alloc] initWithTitle:self.hotelName items:self.data.photos]; auto initialPhoto = galleryModel.items[index]; auto photoVC = [[MWMPhotosViewController alloc] initWithPhotos:galleryModel initialPhoto:initialPhoto @@ -331,15 +331,11 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) - (void)showGalery { logSponsoredEvent(self.data, kPlacePageHotelGallery); - auto galleryVc = [MWMGalleryViewController instanceWithModel:self.galleryModel]; + auto galleryModel = [[MWMGalleryModel alloc] initWithTitle:self.hotelName items:self.data.photos]; + auto galleryVc = [MWMGalleryViewController instanceWithModel:galleryModel]; [[MapViewController controller].navigationController pushViewController:galleryVc animated:YES]; } -- (MWMGalleryModel *)galleryModel -{ - return [[MWMGalleryModel alloc] initWithTitle:self.hotelName items:self.data.photos]; -} - - (void)showAllFacilities { logSponsoredEvent(self.data, kPlacePageHotelFacilities); diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingImageView.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift similarity index 96% rename from iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingImageView.swift rename to iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift index 01c5fc2f50..6336de3e96 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingImageView.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift @@ -1,8 +1,8 @@ import AlamofireImage import UIKit -final class PhotoScalingImageView: UIScrollView { - lazy var imageView: UIImageView = { +final class PhotoScalingView: UIScrollView { + private(set) lazy var imageView: UIImageView = { let imageView = UIImageView(frame: self.bounds) self.addSubview(imageView) return imageView diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoViewController.swift index 703bb542ff..11f799e0eb 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoViewController.swift @@ -1,7 +1,7 @@ import UIKit final class PhotoViewController: UIViewController { - let scalingImageView = PhotoScalingImageView() + let scalingView = PhotoScalingView() let photo: GalleryItemModel @@ -23,45 +23,45 @@ final class PhotoViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - scalingImageView.delegate = self - scalingImageView.frame = view.bounds - scalingImageView.autoresizingMask = [.flexibleWidth, .flexibleHeight] - view.addSubview(scalingImageView) + scalingView.delegate = self + scalingView.frame = view.bounds + scalingView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + view.addSubview(scalingView) view.addGestureRecognizer(doubleTapGestureRecognizer) - scalingImageView.photo = photo + scalingView.photo = photo } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() - scalingImageView.frame = view.bounds + scalingView.frame = view.bounds } @objc private func handleDoubleTapWithGestureRecognizer(_ recognizer: UITapGestureRecognizer) { - let pointInView = recognizer.location(in: scalingImageView.imageView) - var newZoomScale = scalingImageView.maximumZoomScale + let pointInView = recognizer.location(in: scalingView.imageView) + var newZoomScale = scalingView.maximumZoomScale - if scalingImageView.zoomScale >= scalingImageView.maximumZoomScale || - abs(scalingImageView.zoomScale - scalingImageView.maximumZoomScale) <= 0.01 { - newZoomScale = scalingImageView.minimumZoomScale + if scalingView.zoomScale >= scalingView.maximumZoomScale || + abs(scalingView.zoomScale - scalingView.maximumZoomScale) <= 0.01 { + newZoomScale = scalingView.minimumZoomScale } - let scrollViewSize = scalingImageView.bounds.size + let scrollViewSize = scalingView.bounds.size let width = scrollViewSize.width / newZoomScale let height = scrollViewSize.height / newZoomScale let originX = pointInView.x - (width / 2.0) let originY = pointInView.y - (height / 2.0) let rectToZoom = CGRect(x: originX, y: originY, width: width, height: height) - scalingImageView.zoom(to: rectToZoom, animated: true) + scalingView.zoom(to: rectToZoom, animated: true) } } extension PhotoViewController: UIScrollViewDelegate { func viewForZooming(in scrollView: UIScrollView) -> UIView? { - return scalingImageView.imageView + return scalingView.imageView } func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosInteractionAnimator.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosInteractionAnimator.swift index 13183712e1..43c7992dd8 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosInteractionAnimator.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosInteractionAnimator.swift @@ -1,7 +1,7 @@ import UIKit final class PhotosInteractionAnimator: NSObject { - struct Const { + private enum Settings { static let returnToCenterVelocityAnimationRatio: CGFloat = 0.00007 static let panDismissDistanceRatio: CGFloat = 0.075 static let panDismissMaximumDuration: TimeInterval = 0.45 @@ -26,16 +26,14 @@ final class PhotosInteractionAnimator: NSObject { let backgroundAlpha = backgroundAlphaForPanningWithVerticalDelta(verticalDelta) fromView.backgroundColor = fromView.backgroundColor?.withAlphaComponent(backgroundAlpha) - if gestureRecognizer.state == .ended { - finishPanWithPanGestureRecognizer(gestureRecognizer, verticalDelta: verticalDelta,viewToPan: viewToPan, anchorPoint: anchorPoint) + if gestureRecognizer.state == .ended, let transitionContext = transitionContext, let fromView = transitionContext.view(forKey: UITransitionContextViewKey.from) { + let velocityY = gestureRecognizer.velocity(in: gestureRecognizer.view).y + finishPanWith(transitionContext: transitionContext, velocityY: velocityY, verticalDelta: verticalDelta, viewToPan: viewToPan, fromView: fromView, anchorPoint: anchorPoint) } } - private func finishPanWithPanGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer, verticalDelta: CGFloat, viewToPan: UIView, anchorPoint: CGPoint) { - guard let transitionContext = transitionContext, let fromView = transitionContext.view(forKey: UITransitionContextViewKey.from) else { - return - } - let dismissDistance = Const.panDismissDistanceRatio * fromView.bounds.height + private func finishPanWith(transitionContext: UIViewControllerContextTransitioning, velocityY: CGFloat, verticalDelta: CGFloat, viewToPan: UIView, fromView: UIView, anchorPoint: CGPoint) { + let dismissDistance = Settings.panDismissDistanceRatio * fromView.bounds.height let isDismissing = abs(verticalDelta) > dismissDistance if isDismissing, shouldAnimateUsingAnimator, let animator = animator { @@ -44,8 +42,6 @@ final class PhotosInteractionAnimator: NSObject { return } - let velocityY = gestureRecognizer.velocity(in: gestureRecognizer.view).y - let finalPageViewCenterPoint: CGPoint let animationDuration: TimeInterval let finalBackgroundAlpha: CGFloat @@ -56,11 +52,11 @@ final class PhotosInteractionAnimator: NSObject { finalPageViewCenterPoint = CGPoint(x: fromView.center.x, y: finalCenterY) let duration = TimeInterval(abs(finalPageViewCenterPoint.y - viewToPan.center.y) / abs(velocityY)) - animationDuration = min(duration, Const.panDismissMaximumDuration) + animationDuration = min(duration, Settings.panDismissMaximumDuration) finalBackgroundAlpha = 0.0 } else { finalPageViewCenterPoint = anchorPoint - animationDuration = TimeInterval(abs(velocityY) * Const.returnToCenterVelocityAnimationRatio) + kDefaultAnimationDuration + animationDuration = TimeInterval(abs(velocityY) * Settings.returnToCenterVelocityAnimationRatio) + kDefaultAnimationDuration finalBackgroundAlpha = 1.0 } let finalBackgroundColor = fromView.backgroundColor?.withAlphaComponent(finalBackgroundAlpha) diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosTransitionAnimator.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosTransitionAnimator.swift index b419c20b12..ab15e8a55f 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosTransitionAnimator.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosTransitionAnimator.swift @@ -1,7 +1,7 @@ import UIKit final class PhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning { - private struct Const { + private enum Settings { static let animationDurationWithZooming = 2 * kDefaultAnimationDuration static let animationDurationWithoutZooming = kDefaultAnimationDuration static let animationDurationEndingViewFadeInRatio = 0.1 @@ -28,12 +28,12 @@ final class PhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransiti } func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { - return shouldPerformZoomingAnimation ? Const.animationDurationWithZooming : Const.animationDurationWithoutZooming + return shouldPerformZoomingAnimation ? Settings.animationDurationWithZooming : Settings.animationDurationWithoutZooming } private func fadeDurationForTransitionContext(_ transitionContext: UIViewControllerContextTransitioning) -> TimeInterval { let transDuration = transitionDuration(using: transitionContext) - return shouldPerformZoomingAnimation ? transDuration * Const.animationDurationFadeRatio : transDuration + return shouldPerformZoomingAnimation ? transDuration * Settings.animationDurationFadeRatio : transDuration } private func setupTransitionContainerHierarchyWithTransitionContext(_ transitionContext: UIViewControllerContextTransitioning) { @@ -81,8 +81,8 @@ final class PhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransiti startingView.alpha = 0.0 let transDuration = transitionDuration(using: transitionContext) - let fadeInDuration = transDuration * Const.animationDurationEndingViewFadeInRatio - let fadeOutDuration = transDuration * Const.animationDurationStartingViewFadeOutRatio + let fadeInDuration = transDuration * Settings.animationDurationEndingViewFadeInRatio + let fadeOutDuration = transDuration * Settings.animationDurationStartingViewFadeOutRatio UIView.animate(withDuration: fadeInDuration, delay: 0.0, @@ -101,7 +101,7 @@ final class PhotosTransitionAnimator: NSObject, UIViewControllerAnimatedTransiti UIView.animate(withDuration: transDuration, delay: 0.0, - usingSpringWithDamping:Const.zoomingAnimationSpringDamping, + usingSpringWithDamping:Settings.zoomingAnimationSpringDamping, initialSpringVelocity:0, options: [.allowAnimatedContent,.beginFromCurrentState], animations: { () -> Void in diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosViewController.swift index 9fb28f07b7..9b9889fca7 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotosViewController.swift @@ -34,7 +34,7 @@ final class PhotosViewController: MWMViewController { super.init(nibName: nil, bundle: nil) initialSetupWithInitialPhoto(initialPhoto) transitionAnimator.startingView = referenceView - transitionAnimator.endingView = currentPhotoViewController?.scalingImageView.imageView + transitionAnimator.endingView = currentPhotoViewController?.scalingView.imageView } required init?(coder aDecoder: NSCoder) { @@ -111,7 +111,7 @@ final class PhotosViewController: MWMViewController { super.dismiss(animated: flag, completion: completion) return } - transitionAnimator.startingView = currentPhotoViewController?.scalingImageView.imageView + transitionAnimator.startingView = currentPhotoViewController?.scalingView.imageView if let currentPhoto = currentPhoto { transitionAnimator.endingView = referenceViewForPhotoWhenDismissingHandler?(currentPhoto) } else {