diff --git a/ICSPullToRefresh.xcodeproj/project.pbxproj b/ICSPullToRefresh.xcodeproj/project.pbxproj index f583b45..b48cabb 100644 --- a/ICSPullToRefresh.xcodeproj/project.pbxproj +++ b/ICSPullToRefresh.xcodeproj/project.pbxproj @@ -212,6 +212,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -409,7 +410,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -429,7 +430,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.touchingapp.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/ICSPullToRefresh.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ICSPullToRefresh.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ICSPullToRefresh.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ICSPullToRefresh/ICSInfiniteScrolling.swift b/ICSPullToRefresh/ICSInfiniteScrolling.swift index e6a8142..d475024 100644 --- a/ICSPullToRefresh/ICSInfiniteScrolling.swift +++ b/ICSPullToRefresh/ICSInfiniteScrolling.swift @@ -22,7 +22,7 @@ fileprivate struct Constants { public extension UIScrollView{ - public var infiniteScrollingView: InfiniteScrollingView? { + var infiniteScrollingView: InfiniteScrollingView? { get { return objc_getAssociatedObject(self, &infiniteScrollingViewKey) as? InfiniteScrollingView } @@ -33,14 +33,14 @@ public extension UIScrollView{ } } - public var showsInfiniteScrolling: Bool { + var showsInfiniteScrolling: Bool { guard let infiniteScrollingView = infiniteScrollingView else { return false } return !infiniteScrollingView.isHidden } - public func addInfiniteScrollingWithHandler(_ actionHandler: @escaping ActionHandler){ + func addInfiniteScrollingWithHandler(_ actionHandler: @escaping ActionHandler){ if infiniteScrollingView == nil { infiniteScrollingView = InfiniteScrollingView(frame: CGRect(x: CGFloat(0), y: contentSize.height, width: bounds.width, height: Constants.infiniteScrollingViewHeight)) addSubview(infiniteScrollingView!) @@ -51,12 +51,12 @@ public extension UIScrollView{ setShowsInfiniteScrolling(true) } - public func triggerInfiniteScrolling() { + func triggerInfiniteScrolling() { infiniteScrollingView?.state = .triggered infiniteScrollingView?.startAnimating() } - public func setShowsInfiniteScrolling(_ showsInfiniteScrolling: Bool) { + func setShowsInfiniteScrolling(_ showsInfiniteScrolling: Bool) { guard let infiniteScrollingView = infiniteScrollingView else { return } @@ -248,7 +248,7 @@ open class InfiniteScrollingView: UIView { }() fileprivate lazy var activityIndicator: UIActivityIndicatorView = { - let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray) + let activityIndicator = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.gray) activityIndicator.hidesWhenStopped = true return activityIndicator }() @@ -257,8 +257,8 @@ open class InfiniteScrollingView: UIView { activityIndicator.color = color } - open func setActivityIndicatorStyle(_ style: UIActivityIndicatorViewStyle) { - activityIndicator.activityIndicatorViewStyle = style + open func setActivityIndicatorStyle(_ style: UIActivityIndicatorView.Style) { + activityIndicator.style = style } } diff --git a/ICSPullToRefresh/ICSPullToRefresh.swift b/ICSPullToRefresh/ICSPullToRefresh.swift index d74e691..2202732 100644 --- a/ICSPullToRefresh/ICSPullToRefresh.swift +++ b/ICSPullToRefresh/ICSPullToRefresh.swift @@ -23,7 +23,7 @@ fileprivate struct Constants { public extension UIScrollView{ - public var pullToRefreshView: PullToRefreshView? { + var pullToRefreshView: PullToRefreshView? { get { return objc_getAssociatedObject(self, &pullToRefreshViewKey) as? PullToRefreshView } @@ -34,14 +34,14 @@ public extension UIScrollView{ } } - public var showsPullToRefresh: Bool { + var showsPullToRefresh: Bool { guard let pullToRefreshView = pullToRefreshView else { return false } return !pullToRefreshView.isHidden } - public func addPullToRefreshHandler(_ actionHandler: @escaping ActionHandler){ + func addPullToRefreshHandler(_ actionHandler: @escaping ActionHandler){ if pullToRefreshView == nil { pullToRefreshView = PullToRefreshView(frame: CGRect(x: CGFloat(0), y: -Constants.pullToRefreshViewHeight, width: self.bounds.width, height: Constants.pullToRefreshViewHeight)) addSubview(pullToRefreshView!) @@ -52,12 +52,12 @@ public extension UIScrollView{ setShowsPullToRefresh(true) } - public func triggerPullToRefresh() { + func triggerPullToRefresh() { pullToRefreshView?.state = .triggered pullToRefreshView?.startAnimating() } - public func setShowsPullToRefresh(_ showsPullToRefresh: Bool) { + func setShowsPullToRefresh(_ showsPullToRefresh: Bool) { guard let pullToRefreshView = pullToRefreshView else { return } @@ -271,7 +271,7 @@ open class PullToRefreshView: UIView { }() lazy var activityIndicator: UIActivityIndicatorView = { - let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray) + let activityIndicator = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.gray) activityIndicator.hidesWhenStopped = false return activityIndicator }() @@ -280,8 +280,8 @@ open class PullToRefreshView: UIView { activityIndicator.color = color } - open func setActivityIndicatorStyle(_ style: UIActivityIndicatorViewStyle) { - activityIndicator.activityIndicatorViewStyle = style + open func setActivityIndicatorStyle(_ style: UIActivityIndicatorView.Style) { + activityIndicator.style = style } }