From 43b8834736879e509b35261f236778f535bfe483 Mon Sep 17 00:00:00 2001 From: Mikhail Konovalov Date: Thu, 11 Jan 2018 12:40:23 +0300 Subject: [PATCH] =?UTF-8?q?Fileprivate=20=D0=BD=D0=B0=20private?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/RMRPullToRefresh.swift | 2 +- Classes/RMRPullToRefreshController.swift | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Classes/RMRPullToRefresh.swift b/Classes/RMRPullToRefresh.swift index 33a850c..194558f 100644 --- a/Classes/RMRPullToRefresh.swift +++ b/Classes/RMRPullToRefresh.swift @@ -10,7 +10,7 @@ import UIKit open class RMRPullToRefresh: NSObject { - fileprivate var сontroller: RMRPullToRefreshController? + private var сontroller: RMRPullToRefreshController? open var height : CGFloat = RMRPullToRefreshConstants.DefaultHeight { didSet { diff --git a/Classes/RMRPullToRefreshController.swift b/Classes/RMRPullToRefreshController.swift index 2619126..31aee68 100644 --- a/Classes/RMRPullToRefreshController.swift +++ b/Classes/RMRPullToRefreshController.swift @@ -62,13 +62,13 @@ open class RMRPullToRefreshController: NSObject { self.subscribeOnScrollViewEvents() } - fileprivate func configureBackgroundView(_ backgroundView: UIView) { + private func configureBackgroundView(_ backgroundView: UIView) { backgroundView.translatesAutoresizingMaskIntoConstraints = false scrollView?.addSubview(backgroundView) addBackgroundViewConstraints(backgroundView) } - fileprivate func addBackgroundViewConstraints(_ backgroundView: UIView) { + private func addBackgroundViewConstraints(_ backgroundView: UIView) { // Constraints self.backgroundViewHeightConstraint = NSLayoutConstraint(item: backgroundView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 0) backgroundView.addConstraint(self.backgroundViewHeightConstraint!) @@ -84,7 +84,7 @@ open class RMRPullToRefreshController: NSObject { } } - fileprivate func configureHeight() { + private func configureHeight() { if let scrollView = self.scrollView { self.originalTopInset = scrollView.contentInset.top @@ -208,23 +208,23 @@ open class RMRPullToRefreshController: NSObject { containerView.startLoadingAnimation(startProgress) } - @objc fileprivate func stopAllAnimations() { + @objc private func stopAllAnimations() { if shouldHideWhenStopLoading() { stopped = true } containerView.stopAllAnimations(shouldHideWhenStopLoading()) } - @objc fileprivate func forceStopAllAnimations() { + @objc private func forceStopAllAnimations() { stopped = true containerView.stopAllAnimations(true) } - @objc fileprivate func resetBackgroundViewHeightConstraint() { + @objc private func resetBackgroundViewHeightConstraint() { backgroundViewHeightConstraint?.constant = 0 } - fileprivate func scrollViewDidChangePanState(_ scrollView: UIScrollView, panState: UIGestureRecognizerState) { + private func scrollViewDidChangePanState(_ scrollView: UIScrollView, panState: UIGestureRecognizerState) { if panState == .ended || panState == .cancelled || panState == .failed { if state == .loading || (shouldHideWhenStopLoading() && !stopped) { @@ -255,7 +255,7 @@ open class RMRPullToRefreshController: NSObject { } } - fileprivate func scrollViewDidChangeContentSize(_ scrollView: UIScrollView, contentSize: CGSize) { + private func scrollViewDidChangeContentSize(_ scrollView: UIScrollView, contentSize: CGSize) { updateContainerFrame() if position == .bottom { self.backgroundViewTopConstraint?.constant = max(scrollView.contentSize.height, scrollView.bounds.height) @@ -265,7 +265,7 @@ open class RMRPullToRefreshController: NSObject { } } - fileprivate func scrollViewDidScroll(_ scrollView: UIScrollView, contentOffset: CGPoint) { + private func scrollViewDidScroll(_ scrollView: UIScrollView, contentOffset: CGPoint) { if state == .loading { if scrollView.contentOffset.y >= 0 { @@ -297,7 +297,7 @@ open class RMRPullToRefreshController: NSObject { } } - fileprivate func configureBackgroundHeightConstraint(_ contentOffsetY: CGFloat, contentInset: UIEdgeInsets) { + private func configureBackgroundHeightConstraint(_ contentOffsetY: CGFloat, contentInset: UIEdgeInsets) { var constant = CGFloat(-1.0) if position == .top { constant = contentOffsetY + contentInset.top