Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84256152dc | |||
| ac366c84fd |
@@ -1,6 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = "SPStorkController"
|
||||
s.version = "1.5.7"
|
||||
s.version = "1.6"
|
||||
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 }
|
||||
@@ -8,11 +9,11 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.author = { "Ivan Vorobei" => "hello@ivanvorobei.by" }
|
||||
|
||||
s.swift_version = '4.2'
|
||||
s.swift_version = '4.2', '5.0'
|
||||
s.platform = :ios
|
||||
s.ios.framework = 'UIKit'
|
||||
s.ios.deployment_target = "10.0"
|
||||
|
||||
s.source_files = "Source/SPStorkController/**/*.swift"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -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
|
||||
|
||||
+12
-15
@@ -68,21 +68,18 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
|
||||
|
||||
override var frameOfPresentedViewInContainerView: CGRect {
|
||||
guard let containerView = containerView else { return .zero }
|
||||
var customHeight = self.customHeight ?? 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")
|
||||
}
|
||||
let additionTranslate = containerView.bounds.height - customHeight
|
||||
let yOffset: CGFloat = {
|
||||
if customHeight < containerView.bounds.height {
|
||||
return additionTranslate
|
||||
} else {
|
||||
return self.topSpace + 13 + additionTranslate
|
||||
}
|
||||
}()
|
||||
let baseY: CGFloat = self.topSpace + 13
|
||||
let maxHeight: CGFloat = containerView.bounds.height - baseY
|
||||
var height: CGFloat = maxHeight
|
||||
|
||||
return CGRect(x: 0, y: yOffset, width: containerView.bounds.width, height: containerView.bounds.height - yOffset)
|
||||
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() {
|
||||
@@ -353,7 +350,7 @@ extension SPStorkPresentationController {
|
||||
if self.indicatorView.alpha == newAlpha {
|
||||
return
|
||||
}
|
||||
UIView.animate(withDuration: 0.22, animations: {
|
||||
UIView.animate(withDuration: 0.18, animations: {
|
||||
self.indicatorView.alpha = newAlpha
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user