Skip to content

Commit 16094ab

Browse files
authored
Merge pull request #233 from morganchen12/spooky-action
allow consumers to manually set table view and collection view on data sources
2 parents e3eff7b + 50d74b8 commit 16094ab

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

FirebaseDatabaseUI/FUICollectionViewDataSource.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ NS_ASSUME_NONNULL_BEGIN
3737
/**
3838
* The UICollectionView instance that operations (inserts, removals, moves,
3939
* etc.) are performed against. The data source does not claim ownership of
40-
* the collection view it populates.
40+
* the collection view it populates. This collection view must be receiving data
41+
* from this data source otherwise data inconsistency crashes will occur.
4142
*/
42-
@property (nonatomic, readonly, weak) UICollectionView *collectionView;
43+
@property (nonatomic, readwrite, weak, nullable) UICollectionView *collectionView;
4344

4445
/**
4546
* The callback to populate a subclass of UICollectionViewCell with an object

FirebaseDatabaseUI/FUITableViewDataSource.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ NS_ASSUME_NONNULL_BEGIN
3030
* FUITableViewDataSource provides a class that conforms to the
3131
* UITableViewDataSource protocol which allows UITableViews to implement
3232
* FUITableViewDataSource in order to provide a UITableView synchronized
33-
* to a Firebase reference or query.
33+
* to a Firebase reference or query.
3434
*/
3535
@interface FUITableViewDataSource : FUIDataSource<UITableViewDataSource>
3636

3737
/**
3838
* The UITableView instance that operations (inserts, removals, moves, etc.) are
39-
* performed against.
39+
* performed against. This collection view must be receiving data from
40+
* this data source otherwise data inconsistency crashes will occur.
4041
*/
41-
@property (nonatomic, readonly, weak) UITableView *tableView;
42+
@property (nonatomic, readwrite, weak, nullable) UITableView *tableView;
4243

4344
/**
4445
* The callback used by the data source to populate the table view.

FirebaseDatabaseUI/FUITableViewDataSource.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
@interface FUITableViewDataSource ()
2626

27-
@property (nonatomic, readwrite, weak) UITableView *tableView;
28-
2927
@property(strong, nonatomic, readwrite) UITableViewCell *(^populateCell)
3028
(UITableView *tableView, NSIndexPath *indexPath, FIRDataSnapshot *snap);
3129

0 commit comments

Comments
 (0)