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
This commit is contained in:
Adam Sharp 2016-10-11 11:59:47 -07:00 committed by Facebook Github Bot
parent e15311a0a2
commit f833986df2

View file

@ -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()