Improved the documentation

Summary:
Improved the documentation so it that the Getting Started guide calls out that you need to set `dataSource`-property of the `IGListAdapter` as I totally misse that.
Closes https://github.com/Instagram/IGListKit/pull/820

Differential Revision: D5353295

Pulled By: rnystrom

fbshipit-source-id: deca1d75fad08f69081033ae1a65302a4f10ba9f
This commit is contained in:
Weyert de Boer 2017-06-29 18:18:25 -07:00 committed by Facebook Github Bot
parent 33f88b43e8
commit 9f5bf3fb7e
2 changed files with 8 additions and 2 deletions

View file

@ -62,6 +62,12 @@ func emptyView(for listAdapter: ListAdapter) -> UIView? {
}
```
After you have created the data source you need to connect it to the `IGListAdapter` by setting its `dataSource` property:
```swift
adapter.dataSource = self
```
You can return an array of _any_ type of data, as long as it conforms to `IGListDiffable`.
### Immutability

View file

@ -282,7 +282,7 @@
id<IGListAdapterDataSource> dataSource = self.dataSource;
UICollectionView *collectionView = self.collectionView;
if (dataSource == nil || collectionView == nil) {
IGLKLog(@"Warning: Your call to performUpdatesAnimated-method is ignored as dataSource or collectionView haven't been set.");
IGLKLog(@"Warning: Your call to %s is ignored as dataSource or collectionView haven't been set.", __PRETTY_FUNCTION__);
if (completion) {
completion(NO);
}
@ -319,7 +319,7 @@
id<IGListAdapterDataSource> dataSource = self.dataSource;
UICollectionView *collectionView = self.collectionView;
if (dataSource == nil || collectionView == nil) {
IGLKLog(@"Warning: Your call to reloadDataWithCompletion-method is ignored as dataSource or collectionView haven't been set.");
IGLKLog(@"Warning: Your call to %s is ignored as dataSource or collectionView haven't been set.", __PRETTY_FUNCTION__);
if (completion) {
completion(NO);
}