Skip to content

Commit aca3de8

Browse files
committed
add doc comments
1 parent da1c48e commit aca3de8

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

FirebaseDatabaseUI/FUICollection.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,37 @@
2525

2626
NS_ASSUME_NONNULL_BEGIN
2727

28+
/**
29+
* A protocol representing a collection of objects from Firebase Database.
30+
*/
2831
@protocol FUICollection <NSObject>
2932

3033
@property (nonatomic, readonly, copy) NSArray<FIRDataSnapshot *> *items;
3134

3235
@property (weak, nonatomic, nullable) id<FUICollectionDelegate> delegate;
3336

3437
/**
35-
* The number of objects in the FirebaseArray.
38+
* The number of objects in the collection.
3639
*/
3740
@property (nonatomic, readonly) NSUInteger count;
3841

42+
/**
43+
* The @c FIRDataSnapshot at the given index. May raise fatal errors
44+
* if the index is out of bounds.
45+
* @param index The index of a snapshot.
46+
*/
3947
- (FIRDataSnapshot *)snapshotAtIndex:(NSInteger)index;
4048

49+
/**
50+
* Calling this makes the array begin observing updates from its query.
51+
* Before this call is made the array is inert and doesn't do anything.
52+
*/
4153
- (void)observeQuery;
54+
55+
/**
56+
* Cancels all active observations. The array may be reused after this
57+
* is called by calling @c observeQuery again.
58+
*/
4259
- (void)invalidate;
4360

4461
@end

FirebaseDatabaseUI/FUICollectionViewDataSource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
5353
* UICollectionViewCells with FIRDataSnapshots.
5454
* @param collection A FUICollection that the data source uses to pull snapshots
5555
* from Firebase Database.
56-
* @param collectionView An instance of a UICollectionView to bind to. This view
56+
* @param view An instance of a UICollectionView to bind to. This view
5757
* is not retained by its data source.
5858
* @param populateCell A closure used by the data source to create the cells that
5959
* are displayed in the collection view. This closure is retained by the data

FirebaseDatabaseUI/FUIDataSource.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,19 @@
4040
@property (nonatomic, readonly, copy) NSArray *items;
4141

4242
/**
43-
* Pass through of [FirebaseArray count].
43+
* The number of items in the receiver's collection.
4444
*/
4545
@property (nonatomic, readonly) NSUInteger count;
4646

47+
/**
48+
* Takes an FUICollection and immediately starts observing it.
49+
*/
4750
- (instancetype)initWithCollection:(id<FUICollection>)collection NS_DESIGNATED_INITIALIZER;
4851

4952
- (instancetype)init NS_UNAVAILABLE;
5053

5154
/**
52-
* Pass through of [FirebaseArray snapshotAtIndex:].
55+
* Returns the snapshot at the given index in the receiver's collection.
5356
*/
5457
- (FIRDataSnapshot *)objectAtIndex:(NSUInteger)index;
5558

FirebaseDatabaseUI/FUISortedArray.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ NS_ASSUME_NONNULL_BEGIN
2828

2929
- (instancetype)init NS_UNAVAILABLE;
3030

31-
- (instancetype)initWithQuery:(id<FUIDataObservable>)query
31+
/**
32+
* Initializes a sorted collection.
33+
* @param query The query the receiver uses to pull updates from Firebase Database.
34+
* @param delegate The delegate object that should receive events from the array.
35+
* @param sortDescriptor The closure used by the array to sort its contents. This
36+
* block must always return consistent results or the array may raise a fatal error.
37+
*/
38+
- (instancetype)initWithQuery:(id<FIRDataObservable>)query
3239
delegate:(nullable id<FUICollectionDelegate>)delegate
3340
sortDescriptor:(NSComparisonResult (^)(FIRDataSnapshot *left,
3441
FIRDataSnapshot *right))sortDescriptor NS_DESIGNATED_INITIALIZER;
3542

36-
- (void)observeQuery;
37-
- (void)invalidate;
38-
39-
- (FIRDataSnapshot *)snapshotAtIndex:(NSInteger)index;
40-
4143
@end
4244

4345
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)