-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathEmptyCollectionProvider.swift
More file actions
51 lines (43 loc) · 1.11 KB
/
EmptyCollectionProvider.swift
File metadata and controls
51 lines (43 loc) · 1.11 KB
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
//
// BaseCollectionProvider.swift
// CollectionKit
//
// Created by Luke Zhao on 2017-08-15.
// Copyright © 2017 lkzhao. All rights reserved.
//
import UIKit
open class EmptyCollectionProvider: ItemProvider, CollectionReloadable {
open var identifier: String?
public init(identifier: String? = nil) {
self.identifier = identifier
}
open var numberOfItems: Int {
return 0
}
open func view(at: Int) -> UIView {
return UIView()
}
open func update(view: UIView, at: Int) {}
open func identifier(at: Int) -> String {
return "\(at)"
}
open var contentSize: CGSize {
return .zero
}
open func layout(collectionSize: CGSize) {}
open func frame(at: Int) -> CGRect {
return .zero
}
open func visible(in visibleFrame: CGRect) -> (indexes: [Int], frame: CGRect) {
return ([Int](), visibleFrame)
}
open func animator(at: Int) -> Animator? {
return nil
}
open func willReload() {}
open func didReload() {}
open func didTap(view: UIView, at: Int) {}
open func hasReloadable(_ reloadable: CollectionReloadable) -> Bool {
return reloadable === self
}
}