Minor fixes in WorkingRangeViewController.swift

Summary:
Using more suitable type cast.
Using guard statement.

- [x] All tests pass. Demo project builds and runs.
- [ ] 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/98

Differential Revision: D4056145

Pulled By: rnystrom

fbshipit-source-id: 537fccc781747f835155bfe8ccac45a1e8cdb037
This commit is contained in:
Valeriy Van
2016-10-20 19:18:55 -07:00
committed by Facebook Github Bot
parent cad3a55aa6
commit 64784974ed

View File

@@ -27,10 +27,9 @@ class WorkingRangeViewController: UIViewController, IGListAdapterDataSource {
var arr = [Int]()
while arr.count < 20 {
let int = Int(arc4random_uniform(200)) + 200
guard !arr.contains(int) else { continue }
// only use unique values
if !arr.contains(int) {
arr.append(int)
}
arr.append(int)
}
return arr
}()
@@ -51,7 +50,7 @@ class WorkingRangeViewController: UIViewController, IGListAdapterDataSource {
//MARK: IGListAdapterDataSource
func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] {
return data as [NSNumber]
return data as [IGListDiffable]
}
func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController {