Refactor sliding modal, combine options when passing

This commit is contained in:
ismailgulek
2021-06-28 02:13:49 +03:00
parent 29a61647c7
commit b4c510e727
4 changed files with 32 additions and 18 deletions
@@ -56,6 +56,8 @@ class SlidingModalContainerView: UIView, Themable, NibLoadable {
}
}
var centerInScreen: Bool = false
// MARK: Outlets
@IBOutlet private weak var dimmingView: UIView!
@@ -130,7 +132,11 @@ class SlidingModalContainerView: UIView, Themable, NibLoadable {
if UIDevice.current.userInterfaceIdiom == .pad {
self.contentViewBottomConstraint.constant = (UIScreen.main.bounds.height + self.dismissContentViewBottomConstant) / 2
} else {
self.contentViewBottomConstraint.constant = 0
if centerInScreen {
contentViewBottomConstraint.constant = (bounds.height - contentViewHeightConstraint.constant)/2
} else {
contentViewBottomConstraint.constant = 0
}
}
}