Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit 1b84a90

Browse files
Fix api public issue
1 parent 77acc47 commit 1b84a90

6 files changed

Lines changed: 74 additions & 74 deletions

File tree

PullToRefreshKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
5238C7FF1D3763BA00B3B4FE /* Footer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7F91D3763BA00B3B4FE /* Footer.swift */; };
2121
5238C8001D3763BA00B3B4FE /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7FA1D3763BA00B3B4FE /* Header.swift */; };
2222
5238C8011D3763BA00B3B4FE /* Left.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7FB1D3763BA00B3B4FE /* Left.swift */; };
23-
5238C8021D3763BA00B3B4FE /* PullToRefreshKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7FC1D3763BA00B3B4FE /* PullToRefreshKit.swift */; };
23+
5238C8021D3763BA00B3B4FE /* PullToRefresh.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7FC1D3763BA00B3B4FE /* PullToRefresh.swift */; };
2424
5238C8031D3763BA00B3B4FE /* Right.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5238C7FD1D3763BA00B3B4FE /* Right.swift */; };
2525
5238C8071D3763CD00B3B4FE /* arrow_down@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5238C8041D3763CD00B3B4FE /* arrow_down@3x.png */; };
2626
5238C8081D3763CD00B3B4FE /* arrow_left@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5238C8051D3763CD00B3B4FE /* arrow_left@3x.png */; };
@@ -51,7 +51,7 @@
5151
5238C7F91D3763BA00B3B4FE /* Footer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Footer.swift; path = Source/Classes/Footer.swift; sourceTree = SOURCE_ROOT; };
5252
5238C7FA1D3763BA00B3B4FE /* Header.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Header.swift; path = Source/Classes/Header.swift; sourceTree = SOURCE_ROOT; };
5353
5238C7FB1D3763BA00B3B4FE /* Left.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Left.swift; path = Source/Classes/Left.swift; sourceTree = SOURCE_ROOT; };
54-
5238C7FC1D3763BA00B3B4FE /* PullToRefreshKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PullToRefreshKit.swift; path = Source/Classes/PullToRefreshKit.swift; sourceTree = SOURCE_ROOT; };
54+
5238C7FC1D3763BA00B3B4FE /* PullToRefresh.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PullToRefresh.swift; path = Source/Classes/PullToRefresh.swift; sourceTree = SOURCE_ROOT; };
5555
5238C7FD1D3763BA00B3B4FE /* Right.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Right.swift; path = Source/Classes/Right.swift; sourceTree = SOURCE_ROOT; };
5656
5238C8041D3763CD00B3B4FE /* arrow_down@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrow_down@3x.png"; path = "Source/Assets/arrow_down@3x.png"; sourceTree = SOURCE_ROOT; };
5757
5238C8051D3763CD00B3B4FE /* arrow_left@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrow_left@3x.png"; path = "Source/Assets/arrow_left@3x.png"; sourceTree = SOURCE_ROOT; };
@@ -107,7 +107,7 @@
107107
52BB292A1D364C260091F36B /* Classes */ = {
108108
isa = PBXGroup;
109109
children = (
110-
5238C7FC1D3763BA00B3B4FE /* PullToRefreshKit.swift */,
110+
5238C7FC1D3763BA00B3B4FE /* PullToRefresh.swift */,
111111
5238C7FA1D3763BA00B3B4FE /* Header.swift */,
112112
5238C7F91D3763BA00B3B4FE /* Footer.swift */,
113113
5238C7FB1D3763BA00B3B4FE /* Left.swift */,
@@ -260,7 +260,7 @@
260260
5238C8011D3763BA00B3B4FE /* Left.swift in Sources */,
261261
5238C7F51D3758A900B3B4FE /* CustomFooterTableViewController.swift in Sources */,
262262
52BB29281D3644D00091F36B /* SectionModel.swift in Sources */,
263-
5238C8021D3763BA00B3B4FE /* PullToRefreshKit.swift in Sources */,
263+
5238C8021D3763BA00B3B4FE /* PullToRefresh.swift in Sources */,
264264
52261F131D36879C00161ADF /* DefaultBannerController.swift in Sources */,
265265
5238C7D31D37427C00B3B4FE /* TaoBaoRefreshHeader.swift in Sources */,
266266
52E8FB421D336E26000D0BF1 /* MainViewController.swift in Sources */,

Source/Classes/Footer.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
import Foundation
1010
import UIKit
1111

12-
enum RefreshKitFooterText{
12+
public enum RefreshKitFooterText{
1313
case pullToRefresh
1414
case refreshing
1515
case noMoreData
1616
}
17-
class DefaultRefreshFooter:UIView,RefreshableFooter{
18-
let spinner:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
19-
let textLabel:UILabel = UILabel(frame: CGRectMake(0,0,120,40)).SetUp {
17+
public class DefaultRefreshFooter:UIView,RefreshableFooter{
18+
public let spinner:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
19+
public let textLabel:UILabel = UILabel(frame: CGRectMake(0,0,120,40)).SetUp {
2020
$0.font = UIFont.systemFontOfSize(14)
2121
$0.textAlignment = .Center
2222
}
2323
private var textDic = [RefreshKitFooterText:String]()
2424
/**
2525
This function can only be called before refreshing
2626
*/
27-
func setText(text:String,mode:RefreshKitFooterText){
27+
public func setText(text:String,mode:RefreshKitFooterText){
2828
textDic[mode] = text
2929
textLabel.text = textDic[.pullToRefresh]
3030
}
@@ -39,25 +39,25 @@ class DefaultRefreshFooter:UIView,RefreshableFooter{
3939
textDic[.noMoreData] = PullToRefreshKitFooterString.noMoreData
4040
textLabel.text = textDic[.pullToRefresh]
4141
}
42-
required init?(coder aDecoder: NSCoder) {
42+
public required init?(coder aDecoder: NSCoder) {
4343
fatalError("init(coder:) has not been implemented")
4444
}
4545
// MARK: - Refreshable -
46-
func distanceToRefresh() -> CGFloat {
46+
public func distanceToRefresh() -> CGFloat {
4747
return PullToRefreshKitConst.defaultFooterHeight
4848
}
49-
func didBeginRefreshing() {
49+
public func didBeginRefreshing() {
5050
textLabel.text = textDic[.refreshing];
5151
spinner.startAnimating()
5252
}
53-
func didEndRefreshing() {
53+
public func didEndRefreshing() {
5454
textLabel.text = textDic[.pullToRefresh]
5555
spinner.stopAnimating()
5656
}
57-
func didUpdateToNoMoreData(){
57+
public func didUpdateToNoMoreData(){
5858
textLabel.text = textDic[.noMoreData]
5959
}
60-
func didResetToDefault() {
60+
public func didResetToDefault() {
6161
textLabel.text = textDic[.pullToRefresh]
6262
}
6363
}

Source/Classes/Header.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
import UIKit
1212

1313

14-
enum RefreshKitHeaderText{
14+
public enum RefreshKitHeaderText{
1515
case pullToRefresh
1616
case releaseToRefresh
1717
case refreshSuccess
@@ -20,10 +20,10 @@ enum RefreshKitHeaderText{
2020
case refreshing
2121
}
2222

23-
class DefaultRefreshHeader:UIView,RefreshableHeader{
24-
let spinner:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
25-
let textLabel:UILabel = UILabel(frame: CGRectMake(0,0,120,40))
26-
let imageView:UIImageView = UIImageView(frame: CGRectZero)
23+
public class DefaultRefreshHeader:UIView,RefreshableHeader{
24+
public let spinner:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
25+
public let textLabel:UILabel = UILabel(frame: CGRectMake(0,0,120,40))
26+
public let imageView:UIImageView = UIImageView(frame: CGRectZero)
2727
private var textDic = [RefreshKitHeaderText:String]()
2828
override init(frame: CGRect) {
2929
super.init(frame: frame)
@@ -49,17 +49,17 @@ class DefaultRefreshHeader:UIView,RefreshableHeader{
4949
textDic[.refreshing] = PullToRefreshKitHeaderString.refreshing
5050
textLabel.text = textDic[.pullToRefresh]
5151
}
52-
required init?(coder aDecoder: NSCoder) {
52+
required public init?(coder aDecoder: NSCoder) {
5353
fatalError("init(coder:) has not been implemented")
5454
}
55-
func setText(text:String,mode:RefreshKitHeaderText){
55+
public func setText(text:String,mode:RefreshKitHeaderText){
5656
textDic[mode] = text
5757
}
5858
// MARK: - Refreshable -
59-
func distanceToRefresh() -> CGFloat {
59+
public func distanceToRefresh() -> CGFloat {
6060
return PullToRefreshKitConst.defaultHeaderHeight
6161
}
62-
func percentageChangedDuringDragging(percent:CGFloat){
62+
public func percentageChangedDuringDragging(percent:CGFloat){
6363
self.hidden = !(percent > 0.0)
6464
if percent > 1.0{
6565
textLabel.text = textDic[.releaseToRefresh]
@@ -80,7 +80,7 @@ class DefaultRefreshHeader:UIView,RefreshableHeader{
8080
})
8181
}
8282
}
83-
func willEndRefreshing(result:RefreshResult) {
83+
public func willEndRefreshing(result:RefreshResult) {
8484
spinner.stopAnimating()
8585
imageView.transform = CGAffineTransformIdentity
8686
imageView.hidden = false
@@ -95,22 +95,22 @@ class DefaultRefreshHeader:UIView,RefreshableHeader{
9595
textLabel.text = textDic[.pullToRefresh]
9696
}
9797
}
98-
func didEndRefreshing(result:RefreshResult) {
98+
public func didEndRefreshing(result:RefreshResult) {
9999
textLabel.text = textDic[.pullToRefresh]
100100
self.hidden = true
101101
}
102-
func willBeginRefreshing() {
102+
public func willBeginRefreshing() {
103103
self.hidden = false
104104
textLabel.text = textDic[.refreshing]
105105
spinner.startAnimating()
106106
imageView.hidden = true
107107
}
108-
func didBeginRefreshing() {
108+
public func didBeginRefreshing() {
109109

110110
}
111111
}
112112

113-
class RefreshHeaderContainer:UIView{
113+
public class RefreshHeaderContainer:UIView{
114114
// MARK: - Propertys -
115115
enum RefreshHeaderState {
116116
case Idle
@@ -176,18 +176,18 @@ class RefreshHeaderContainer:UIView{
176176
self.backgroundColor = UIColor.clearColor()
177177
self.autoresizingMask = .FlexibleWidth
178178
}
179-
required init?(coder aDecoder: NSCoder) {
179+
required public init?(coder aDecoder: NSCoder) {
180180
fatalError("init(coder:) has not been implemented")
181181
}
182182

183183
// MARK: - Life circle -
184-
override func drawRect(rect: CGRect) {
184+
public override func drawRect(rect: CGRect) {
185185
super.drawRect(rect)
186186
if self.state == .WillRefresh {
187187
self.state = .Refreshing
188188
}
189189
}
190-
override func willMoveToSuperview(newSuperview: UIView?) {
190+
public override func willMoveToSuperview(newSuperview: UIView?) {
191191
super.willMoveToSuperview(newSuperview)
192192
guard newSuperview is UIScrollView else{
193193
return;
@@ -243,7 +243,7 @@ class RefreshHeaderContainer:UIView{
243243
}
244244
}
245245
// MARK: - KVO -
246-
override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
246+
override public func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
247247
guard self.userInteractionEnabled else{
248248
return;
249249
}

Source/Classes/Left.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
import Foundation
1010
import UIKit
1111

12-
enum RefreshKitLeftRightText{
12+
public enum RefreshKitLeftRightText{
1313
case scrollToAction
1414
case releaseToAction
1515
}
16-
class DefaultRefreshLeft:UIView,RefreshableLeftRight{
17-
let imageView:UIImageView = UIImageView().SetUp {
16+
public class DefaultRefreshLeft:UIView,RefreshableLeftRight{
17+
public let imageView:UIImageView = UIImageView().SetUp {
1818
$0.image = UIImage(named: "arrow_right")
1919
}
20-
let textLabel:UILabel = UILabel().SetUp {
20+
public let textLabel:UILabel = UILabel().SetUp {
2121
$0.font = UIFont.systemFontOfSize(14)
2222
}
2323
private var textDic = [RefreshKitLeftRightText:String]()
2424

2525
/**
2626
You can only call this function before pull
2727
*/
28-
func setText(text:String,mode:RefreshKitLeftRightText){
28+
public func setText(text:String,mode:RefreshKitLeftRightText){
2929
textDic[mode] = text
3030
textLabel.text = textDic[.scrollToAction]
3131
}
@@ -43,15 +43,15 @@ class DefaultRefreshLeft:UIView,RefreshableLeftRight{
4343
textDic[.releaseToAction] = PullToRefreshKitLeftString.releaseToAction
4444
textLabel.text = textDic[.scrollToAction]
4545
}
46-
required init?(coder aDecoder: NSCoder) {
46+
public required init?(coder aDecoder: NSCoder) {
4747
fatalError("init(coder:) has not been implemented")
4848
}
4949

5050
// MARK: - RefreshableLeftRight Protocol -
51-
func distanceToRefresh() -> CGFloat {
51+
public func distanceToRefresh() -> CGFloat {
5252
return PullToRefreshKitConst.defaultHeaderHeight
5353
}
54-
func percentageChangedDuringDragging(percent:CGFloat){
54+
public func percentageChangedDuringDragging(percent:CGFloat){
5555
if percent > 1.0{
5656
guard CGAffineTransformEqualToTransform(self.imageView.transform, CGAffineTransformIdentity) else{
5757
return
@@ -71,10 +71,10 @@ class DefaultRefreshLeft:UIView,RefreshableLeftRight{
7171
})
7272
}
7373
}
74-
func didBeginRefreshing() {
74+
public func didBeginRefreshing() {
7575

7676
}
77-
func didEndRefreshing() {
77+
public func didEndRefreshing() {
7878
textLabel.text = textDic[.scrollToAction]
7979
}
8080
}

0 commit comments

Comments
 (0)