From d1003df84544966aa5371ab89ba65a6deb9d4b16 Mon Sep 17 00:00:00 2001 From: Jake Lin Date: Thu, 27 Oct 2016 09:57:41 -0700 Subject: [PATCH] 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 --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53598be8..1c846b85 100644 --- a/README.md +++ b/README.md @@ -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 } ```