@@ -24,43 +24,43 @@ public class _CollectionViewSectionedDataSource
24
24
return _numberOfSectionsInCollectionView ( collectionView)
25
25
}
26
26
27
- func _collectionView ( collectionView: UICollectionView , numberOfItemsInSection section: Int ) -> Int {
27
+ func _rx_collectionView ( collectionView: UICollectionView , numberOfItemsInSection section: Int ) -> Int {
28
28
return 0
29
29
}
30
30
31
31
public func collectionView( collectionView: UICollectionView , numberOfItemsInSection section: Int ) -> Int {
32
- return _collectionView ( collectionView, numberOfItemsInSection: section)
32
+ return _rx_collectionView ( collectionView, numberOfItemsInSection: section)
33
33
}
34
34
35
- func _collectionView ( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
35
+ func _rx_collectionView ( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
36
36
return ( nil as UICollectionViewCell ? ) !
37
37
}
38
38
39
39
public func collectionView( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
40
- return _collectionView ( collectionView, cellForItemAtIndexPath: indexPath)
40
+ return _rx_collectionView ( collectionView, cellForItemAtIndexPath: indexPath)
41
41
}
42
42
43
- func _collectionView ( collectionView: UICollectionView , viewForSupplementaryElementOfKind kind: String , atIndexPath indexPath: NSIndexPath ) -> UICollectionReusableView {
43
+ func _rx_collectionView ( collectionView: UICollectionView , viewForSupplementaryElementOfKind kind: String , atIndexPath indexPath: NSIndexPath ) -> UICollectionReusableView {
44
44
return ( nil as UICollectionReusableView ? ) !
45
45
}
46
46
47
47
public func collectionView( collectionView: UICollectionView , viewForSupplementaryElementOfKind kind: String , atIndexPath indexPath: NSIndexPath ) -> UICollectionReusableView {
48
- return _collectionView ( collectionView, viewForSupplementaryElementOfKind: kind, atIndexPath: indexPath)
48
+ return _rx_collectionView ( collectionView, viewForSupplementaryElementOfKind: kind, atIndexPath: indexPath)
49
49
}
50
50
51
- func _collectionView ( collectionView: UICollectionView , canMoveItemAtIndexPath indexPath: NSIndexPath ) -> Bool {
52
- return false
51
+ func _rx_collectionView ( collectionView: UICollectionView , canMoveItemAtIndexPath indexPath: NSIndexPath ) -> Bool {
52
+ return true
53
53
}
54
54
55
55
public func collectionView( collectionView: UICollectionView , canMoveItemAtIndexPath indexPath: NSIndexPath ) -> Bool {
56
- return _collectionView ( collectionView, canMoveItemAtIndexPath: indexPath)
56
+ return _rx_collectionView ( collectionView, canMoveItemAtIndexPath: indexPath)
57
57
}
58
58
59
- func _collectionView ( collectionView: UICollectionView , moveItemAtIndexPath sourceIndexPath: NSIndexPath , toIndexPath destinationIndexPath: NSIndexPath ) {
59
+ func _rx_collectionView ( collectionView: UICollectionView , moveItemAtIndexPath sourceIndexPath: NSIndexPath , toIndexPath destinationIndexPath: NSIndexPath ) {
60
60
61
61
}
62
62
public func collectionView( collectionView: UICollectionView , moveItemAtIndexPath sourceIndexPath: NSIndexPath , toIndexPath destinationIndexPath: NSIndexPath ) {
63
- _collectionView ( collectionView, moveItemAtIndexPath: sourceIndexPath, toIndexPath: destinationIndexPath)
63
+ _rx_collectionView ( collectionView, moveItemAtIndexPath: sourceIndexPath, toIndexPath: destinationIndexPath)
64
64
}
65
65
66
66
}
@@ -134,33 +134,30 @@ public class CollectionViewSectionedDataSource<S: SectionModelType>
134
134
return _sectionModels. count
135
135
}
136
136
137
- override func _collectionView ( collectionView: UICollectionView , numberOfItemsInSection section: Int ) -> Int {
137
+ override func _rx_collectionView ( collectionView: UICollectionView , numberOfItemsInSection section: Int ) -> Int {
138
138
return _sectionModels [ section] . items. count
139
139
}
140
140
141
- override func _collectionView ( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
141
+ override func _rx_collectionView ( collectionView: UICollectionView , cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell {
142
142
precondition ( indexPath. item < _sectionModels [ indexPath. section] . items. count)
143
143
144
144
return cellFactory ( self , collectionView, indexPath, itemAtIndexPath ( indexPath) )
145
145
}
146
146
147
- override func _collectionView ( collectionView: UICollectionView , viewForSupplementaryElementOfKind kind: String , atIndexPath indexPath: NSIndexPath ) -> UICollectionReusableView {
147
+ override func _rx_collectionView ( collectionView: UICollectionView , viewForSupplementaryElementOfKind kind: String , atIndexPath indexPath: NSIndexPath ) -> UICollectionReusableView {
148
148
return supplementaryViewFactory ( self , collectionView, kind, indexPath)
149
149
}
150
150
151
- override func _collectionView ( collectionView: UICollectionView , canMoveItemAtIndexPath indexPath: NSIndexPath ) -> Bool {
151
+ override func _rx_collectionView ( collectionView: UICollectionView , canMoveItemAtIndexPath indexPath: NSIndexPath ) -> Bool {
152
152
guard let canMoveItem = canMoveItemAtIndexPath ? ( self , indexPath: indexPath) else {
153
- return super. _collectionView ( collectionView, canMoveItemAtIndexPath: indexPath)
153
+ return super. _rx_collectionView ( collectionView, canMoveItemAtIndexPath: indexPath)
154
154
}
155
155
156
156
return canMoveItem
157
157
}
158
158
159
- override func _collectionView( collectionView: UICollectionView , moveItemAtIndexPath sourceIndexPath: NSIndexPath , toIndexPath destinationIndexPath: NSIndexPath ) {
160
- guard let _ = moveItem ? ( self , sourceIndexPath: sourceIndexPath, destinationIndexPath: destinationIndexPath) else {
161
- super. _collectionView ( collectionView, moveItemAtIndexPath: sourceIndexPath, toIndexPath: destinationIndexPath)
162
- return
163
- }
159
+ override func _rx_collectionView( collectionView: UICollectionView , moveItemAtIndexPath sourceIndexPath: NSIndexPath , toIndexPath destinationIndexPath: NSIndexPath ) {
160
+ self . _sectionModels. moveFromSourceIndexPath ( sourceIndexPath, destinationIndexPath: destinationIndexPath)
164
161
}
165
162
166
163
}
0 commit comments