-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKissPaginate.podspec
83 lines (69 loc) · 2.94 KB
/
KissPaginate.podspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Be sure to run `pod lib lint KissPaginate.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'KissPaginate'
s.version = '0.3.13'
s.summary = 'Simplify your implementation of tableView paginate.'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
```
class ViewController: PaginateViewController {
@IBOutlet weak var noElementLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
tableView.dataSource = self
refreshElements()
}
override var getElementsClosure: (page: Int, successHandler: GetElementsSuccessHandler, failureHandler: (error: Error) -> Void) -> Void {
return getElementList
}
func getElementList(page: Int, successHandler: GetElementsSuccessHandler, failureHandler: (error: Error) -> Void) {
let elements = (0...20).map { "page \(page), element index" + String($0) }
delay(2) {
successHandler(elements: elements, hasMoreElements: true)
}
}
override func displayNoElementIfNeeded(noElement: Bool) {
noElementLabel.hidden = !noElement
}
}
extension ViewController: UITableViewDataSource {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return elements.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell")!
let element = getElement(String.self, at: indexPath.row)
cell.textLabel?.text = element
if elements.count == indexPath.row + 1 {
loadNextPage()
}
return cell
}
}
```
DESC
s.homepage = 'https://github.com/WANGjieJacques/KissPaginate'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'WANG Jie' => '[email protected]' }
s.source = { :git => 'https://github.com/WANGjieJacques/KissPaginate.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.ios.deployment_target = '8.0'
s.source_files = 'KissPaginate/Classes/**/*'
# s.resource_bundles = {
# 'KissPaginate' => ['KissPaginate/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end