Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
Fix bug when present 2 or more controllers with custom heights. Also fix bug with grade for `presentingController` view.
  • Loading branch information
Ivan Vorobei committed Feb 13, 2019
1 parent dce5b8a commit 9ba71f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/SPStorkController/SPStorkPresentationController.swift
Expand Up @@ -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

Expand Down Expand Up @@ -227,14 +228,15 @@ 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

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
Expand Down

0 comments on commit 9ba71f1

Please sign in to comment.