From 9ba71f1d67bae6baa895ceb5554fc151311df2c3 Mon Sep 17 00:00:00 2001 From: Ivan Vorobei Date: Thu, 14 Feb 2019 00:23:35 +0300 Subject: [PATCH] Fix some bugs Fix bug when present 2 or more controllers with custom heights. Also fix bug with grade for `presentingController` view. --- .../SPStorkController/SPStorkPresentationController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/SPStorkController/SPStorkPresentationController.swift b/Source/SPStorkController/SPStorkPresentationController.swift index 21d217f..d24199f 100644 --- a/Source/SPStorkController/SPStorkPresentationController.swift +++ b/Source/SPStorkController/SPStorkPresentationController.swift @@ -135,8 +135,9 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz containerView.insertSubview(snapshotView, aboveSubview: self.backgroundView) snapshotView.frame = initialFrame snapshotView.transform = transformForSnapshotView - snapshotView.alpha = self.alpha + snapshotView.alpha = 1 - self.alpha snapshotView.layer.cornerRadius = self.cornerRadius + snapshotView.contentMode = .top snapshotView.layer.masksToBounds = true rootSnapshotView = snapshotView @@ -227,6 +228,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz containerView.insertSubview(snapshotView, aboveSubview: backgroundView) snapshotView.frame = initialFrame snapshotView.transform = initialTransform + snapshotView.contentMode = .top rootSnapshotView = snapshotView snapshotView.layer.cornerRadius = self.cornerRadius snapshotView.layer.masksToBounds = true @@ -234,7 +236,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz let snapshotRoundedView = UIView() snapshotRoundedView.layer.cornerRadius = self.cornerRadius snapshotRoundedView.layer.masksToBounds = true - snapshotRoundedView.backgroundColor = UIColor.black.withAlphaComponent(1 - self.alpha) + snapshotRoundedView.backgroundColor = UIColor.black.withAlphaComponent(self.alpha) containerView.insertSubview(snapshotRoundedView, aboveSubview: snapshotView) snapshotRoundedView.frame = initialFrame snapshotRoundedView.transform = initialTransform