From f833986df28916df301913e7380a60103ffe0733 Mon Sep 17 00:00:00 2001 From: Adam Sharp Date: Tue, 11 Oct 2016 11:59:47 -0700 Subject: [PATCH] Use type checking instead of casting in README Summary: Just a little improvement to a code example. - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/45 Reviewed By: jessesquires Differential Revision: D4002830 Pulled By: rnystrom fbshipit-source-id: b6fb8f87752f0886333c4445107caac8219027e9 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea8824a9..3e367dd0 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ func objectsForListAdapter(listAdapter: IGListAdapter) -> [IGListDiffable] { func listAdapter(listAdapter: IGListAdapter, sectionControllerForObject(object: Any) -> IGListSectionController { - if let _ = object as? String { + if object is String { return LabelSectionController() } else { return NumberSectionController()