Правки анимации
This commit is contained in:
parent
2e700cf269
commit
ab9f81efba
|
|
@ -45,8 +45,8 @@ public class RMRPullToRefresh: NSObject {
|
|||
сontroller?.configureView(view, state: state, result: result)
|
||||
}
|
||||
|
||||
public func configureView(view :RMRPullToRefreshView) {
|
||||
сontroller?.configureView(view, result: .Success)
|
||||
public func configureView(view :RMRPullToRefreshView, result:RMRPullToRefreshResultType) {
|
||||
сontroller?.configureView(view, result: result)
|
||||
}
|
||||
|
||||
public func setupDefaultSettings() {
|
||||
|
|
|
|||
|
|
@ -208,7 +208,9 @@ public class RMRPullToRefreshController: NSObject {
|
|||
}
|
||||
|
||||
@objc private func stopAllAnimations() {
|
||||
stopped = true
|
||||
if shouldHideWhenStopLoading() {
|
||||
stopped = true
|
||||
}
|
||||
containerView.stopAllAnimations(shouldHideWhenStopLoading())
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +226,7 @@ public class RMRPullToRefreshController: NSObject {
|
|||
private func scrollViewDidChangePanState(scrollView: UIScrollView, panState: UIGestureRecognizerState) {
|
||||
if panState == .Ended || panState == .Cancelled || panState == .Failed {
|
||||
|
||||
if state == .Loading || !stopped {
|
||||
if state == .Loading || (shouldHideWhenStopLoading() && !stopped) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -248,18 +250,6 @@ public class RMRPullToRefreshController: NSObject {
|
|||
} else {
|
||||
state = .Stopped
|
||||
updateContainerView(state)
|
||||
if !shouldHideWhenStopLoading() {
|
||||
var inset = scrollView.contentInset
|
||||
if position == .Top && inset.top != originalTopInset {
|
||||
inset.top = originalTopInset
|
||||
setContentInset(inset, animated: true)
|
||||
self.performSelector(#selector(forceStopAllAnimations), withObject: nil, afterDelay: 0.2)
|
||||
} else if position == .Bottom && inset.top != originalBottomInset {
|
||||
inset.bottom = originalBottomInset
|
||||
setContentInset(inset, animated: true)
|
||||
self.performSelector(#selector(forceStopAllAnimations), withObject: nil, afterDelay: 0.2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega
|
|||
} else if exampleType == .RedmadrobotTop || exampleType == .RedmadrobotBottom {
|
||||
redmadrobot()
|
||||
}
|
||||
|
||||
pullToRefresh?.setHideDelay(5.0, result: .Success)
|
||||
|
||||
pullToRefresh?.hideWhenError = false
|
||||
}
|
||||
|
||||
// MARK: - Build example values
|
||||
|
|
|
|||
Loading…
Reference in New Issue