Compare commits

..

1 Commits

Author SHA1 Message Date
Ivan Vorobei ac366c84fd Update to 1.5.8 2019-03-25 23:30:30 +03:00
3 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SPStorkController"
s.version = "1.5.7"
s.version = "1.5.8"
s.summary = "Modal controller as mail or Apple music application"
s.homepage = "https://github.com/IvanVorobei/SPStorkController"
s.source = { :git => "https://github.com/IvanVorobei/SPStorkController.git", :tag => s.version }
@@ -38,7 +38,7 @@ extension UIViewController {
self.present(controller, animated: true, completion: nil)
}
public func presentAsStork(_ controller: UIViewController, height: CGFloat? = nil, showIndicator: Bool = false, hideIndicatorWhenScroll: Bool, showCloseButton: Bool = false, complection: (() -> Void)? = nil) {
public func presentAsStork(_ controller: UIViewController, height: CGFloat?, showIndicator: Bool, hideIndicatorWhenScroll: Bool, showCloseButton: Bool, complection: (() -> Void)?) {
let transitionDelegate = SPStorkTransitioningDelegate()
transitionDelegate.customHeight = height
transitionDelegate.showCloseButton = showCloseButton
@@ -68,7 +68,9 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
override var frameOfPresentedViewInContainerView: CGRect {
guard let containerView = containerView else { return .zero }
var customHeight = self.customHeight ?? containerView.bounds.height
/*var customHeight = self.customHeight ?? containerView.bounds.height
print(customHeight "\(customHeight)")
print("containerView.bounds.height \(containerView.bounds.height)")
if customHeight > containerView.bounds.height {
customHeight = containerView.bounds.height
print("SPStorkController - Custom height change to default value. Your height more maximum value")
@@ -81,8 +83,22 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
return self.topSpace + 13 + additionTranslate
}
}()
print("yOffset \(yOffset)")
return CGRect(x: 0, y: yOffset, width: containerView.bounds.width, height: containerView.bounds.height - yOffset)*/
return CGRect(x: 0, y: yOffset, width: containerView.bounds.width, height: containerView.bounds.height - yOffset)
let baseY: CGFloat = self.topSpace + 13
let maxHeight: CGFloat = containerView.bounds.height - baseY
var height: CGFloat = maxHeight
if let customHeight = self.customHeight {
if customHeight < maxHeight {
height = customHeight
} else {
print("SPStorkController - Custom height change to default value. Your height more maximum value")
}
}
return CGRect(x: 0, y: containerView.bounds.height - height, width: containerView.bounds.width, height: height)
}
override func presentationTransitionWillBegin() {