mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-23 17:28:22 +00:00
Update the Swift code syntax for reflecting the current APIs for Swift.
Summary: In this PR, we updated the Swift code syntax for reflecting the current APIs for Swift. - [x] All tests pass. Demo project builds and runs. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/116 Differential Revision: D4089084 Pulled By: rnystrom fbshipit-source-id: 9c90c2f6d5c52d202086a05efc3fe3b07da41ce3
This commit is contained in:
parent
e3ea1903f7
commit
d1003df845
1 changed files with 3 additions and 4 deletions
|
|
@ -87,13 +87,12 @@ adapter.collectionView = collectionView
|
|||
The last step is the `IGListAdapter`'s data source and returning some data.
|
||||
|
||||
```swift
|
||||
func objectsForListAdapter(listAdapter: IGListAdapter) -> [IGListDiffable] {
|
||||
func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
|
||||
// this can be anything!
|
||||
return [ "Foo", "Bar", 42, "Biz" ]
|
||||
}
|
||||
|
||||
func listAdapter(listAdapter: IGListAdapter,
|
||||
sectionControllerFor object: Any) -> IGListSectionController {
|
||||
func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {
|
||||
if object is String {
|
||||
return LabelSectionController()
|
||||
} else {
|
||||
|
|
@ -101,7 +100,7 @@ func listAdapter(listAdapter: IGListAdapter,
|
|||
}
|
||||
}
|
||||
|
||||
func emptyViewForListAdapter(listAdapter: IGListAdapter) -> UIView? {
|
||||
func emptyView(for listAdapter: IGListAdapter) -> UIView? {
|
||||
return nil
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue