Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ICSPullToRefresh.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
16 changes: 8 additions & 8 deletions ICSPullToRefresh/ICSInfiniteScrolling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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!)
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}()
Expand All @@ -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
}

}
16 changes: 8 additions & 8 deletions ICSPullToRefresh/ICSPullToRefresh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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!)
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}()
Expand All @@ -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
}

}