Compare commits

..

2 Commits

Author SHA1 Message Date
Ivan Vorobei 84256152dc Update to 1.6
Update duration animation for show / hide indicator view when scrolling.
2019-03-26 14:19:27 +03:00
Ivan Vorobei ac366c84fd Update to 1.5.8 2019-03-25 23:30:30 +03:00
3 changed files with 18 additions and 20 deletions
+5 -4
View File
@@ -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
@@ -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
})
}