@@ -77,13 +77,11 @@ public class _TableViewSectionedDataSource
77
77
func _sectionIndexTitlesForTableView( _ tableView: UITableView ) -> [ String ] ? {
78
78
return nil
79
79
}
80
-
80
+
81
81
public func sectionIndexTitles( for tableView: UITableView ) -> [ String ] ? {
82
82
return _sectionIndexTitlesForTableView ( tableView)
83
83
}
84
- #endif
85
84
86
- #if os(iOS)
87
85
func _rx_tableView( _ tableView: UITableView , sectionForSectionIndexTitle title: String , atIndex index: Int ) -> Int {
88
86
return 0
89
87
}
@@ -142,13 +140,13 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
142
140
}
143
141
144
142
public func itemAtIndexPath( _ indexPath: IndexPath ) -> I {
145
- return self . _sectionModels [ ( indexPath as NSIndexPath ) . section] . items [ ( indexPath as NSIndexPath ) . item]
143
+ return self . _sectionModels [ indexPath. section] . items [ indexPath. item]
146
144
}
147
145
148
146
public func setItem( item: I , indexPath: IndexPath ) {
149
- var section = self . _sectionModels [ ( indexPath as NSIndexPath ) . section]
150
- section. items [ ( indexPath as NSIndexPath ) . item] = item
151
- self . _sectionModels [ ( indexPath as NSIndexPath ) . section] = section
147
+ var section = self . _sectionModels [ indexPath. section]
148
+ section. items [ indexPath. item] = item
149
+ self . _sectionModels [ indexPath. section] = section
152
150
}
153
151
154
152
public func modelAtIndexPath( _ indexPath: IndexPath ) throws -> Any {
@@ -238,7 +236,7 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
238
236
}
239
237
240
238
override func _rx_tableView( _ tableView: UITableView , cellForRowAtIndexPath indexPath: IndexPath ) -> UITableViewCell {
241
- precondition ( ( indexPath as NSIndexPath ) . item < _sectionModels [ ( indexPath as NSIndexPath ) . section] . items. count)
239
+ precondition ( indexPath. item < _sectionModels [ indexPath. section] . items. count)
242
240
243
241
return configureCell ( self , tableView, indexPath, itemAtIndexPath ( indexPath) )
244
242
}
@@ -288,5 +286,4 @@ public class RxTableViewSectionedDataSource<S: SectionModelType>
288
286
return section
289
287
}
290
288
#endif
291
-
292
289
}
0 commit comments