Skip to content

Commit 02cfb6f

Browse files
committed
Merge branch 'firebaseui-0.2.0'
* firebaseui-0.2.0: 0.2.0 release candidate: + FirebaseCollectionViewDataSource + Nullability annotations and improved swift support + Documentation! Please enter the commit message for your changes. Lines starting FirebaseUI 0.2.0 release: + FirebaseCollectionViewDataSource Ignoring /target.
2 parents 3d05238 + a6b0165 commit 02cfb6f

35 files changed

+2790
-95
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ DerivedData
1919

2020
# Third Party
2121
/sdk
22+
23+
# Generated
24+
/target
25+
/site

FirebaseUI.podspec

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
Pod::Spec.new do |s|
22
s.name = "FirebaseUI"
3-
s.version = "0.1.2"
3+
s.version = "0.2.0"
44
s.summary = "UI binding libraries for Firebase."
55
s.homepage = "https://github.com/firebase/FirebaseUI-iOS"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }
77
s.author = { "Firebase" => "[email protected]" }
8-
s.source = { :git => "https://github.com/firebase/FirebaseUI-iOS.git", :tag => 'v0.1.2' }
8+
s.social_media_url = "https://twitter.com/firebase"
9+
s.source = { :git => "https://github.com/firebase/FirebaseUI-iOS.git", :tag => 'v0.2.0' }
910
s.source_files = "FirebaseUI/**/*.{h,m}"
10-
s.dependency 'Firebase', '~> 2.3'
11+
s.dependency "Firebase", "~> 2.2"
1112
s.platform = :ios
12-
s.ios.deployment_target = '7.0'
13+
s.ios.deployment_target = "7.0"
1314
s.libraries = "c++", "icucore"
14-
s.ios.framework = "CFNetwork", "Security", "Firebase", "SystemConfiguration", "UIKit", "Foundation"
15-
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Firebase"'}
15+
s.ios.framework = "UIKit", "Firebase", "Security", "CFNetwork", "SystemConfiguration"
16+
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Firebase"' }
1617
s.requires_arc = true
1718
end

FirebaseUI.xcodeproj/project.pbxproj

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
D8B6ACF81B583D3E005CDDB2 /* FirebaseUI.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6ACEB1B583C33005CDDB2 /* FirebaseUI.h */; settings = {ATTRIBUTES = (Public, ); }; };
3434
D8B6ACF91B583D3E005CDDB2 /* FirebaseDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6ACED1B583C33005CDDB2 /* FirebaseDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
3535
D8B6ACFB1B583D48005CDDB2 /* FirebaseArray.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6ACEC1B583C33005CDDB2 /* FirebaseArray.h */; settings = {ATTRIBUTES = (Public, ); }; };
36+
D8DA10F11B7AC50400D00954 /* FirebaseCollectionViewDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
37+
D8DF55621B742DB40030E996 /* FirebaseCollectionViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = D8DF55611B742DB40030E996 /* FirebaseCollectionViewDataSource.m */; };
3638
/* End PBXBuildFile section */
3739

3840
/* Begin PBXContainerItemProxy section */
@@ -68,13 +70,10 @@
6870
D8B6ACEF1B583C41005CDDB2 /* FirebaseArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirebaseArray.m; path = Implementation/FirebaseArray.m; sourceTree = "<group>"; };
6971
D8B6ACF11B583C41005CDDB2 /* FirebaseTableViewDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirebaseTableViewDataSource.m; path = Implementation/FirebaseTableViewDataSource.m; sourceTree = "<group>"; };
7072
D8B6ACF21B583C41005CDDB2 /* FirebaseDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirebaseDataSource.m; path = Implementation/FirebaseDataSource.m; sourceTree = "<group>"; };
71-
D8B6AD971B58D45F005CDDB2 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; };
72-
D8B6AD991B58D486005CDDB2 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
73-
D8B6AD9B1B58D48C005CDDB2 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
74-
D8B6AD9D1B58D494005CDDB2 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
75-
D8B6AD9F1B58D49E005CDDB2 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
7673
D8C579A61B57349000899F86 /* libFirebaseUI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFirebaseUI.a; sourceTree = BUILT_PRODUCTS_DIR; };
7774
D8C579BB1B5837DF00899F86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
75+
D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FirebaseCollectionViewDataSource.h; path = API/FirebaseCollectionViewDataSource.h; sourceTree = "<group>"; };
76+
D8DF55611B742DB40030E996 /* FirebaseCollectionViewDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirebaseCollectionViewDataSource.m; path = Implementation/FirebaseCollectionViewDataSource.m; sourceTree = "<group>"; };
7877
/* End PBXFileReference section */
7978

8079
/* Begin PBXFrameworksBuildPhase section */
@@ -95,11 +94,6 @@
9594
isa = PBXGroup;
9695
children = (
9796
D8124F401B72A90C003441AD /* Firebase.framework */,
98-
D8B6AD9F1B58D49E005CDDB2 /* SystemConfiguration.framework */,
99-
D8B6AD9D1B58D494005CDDB2 /* Security.framework */,
100-
D8B6AD9B1B58D48C005CDDB2 /* CFNetwork.framework */,
101-
D8B6AD991B58D486005CDDB2 /* libicucore.dylib */,
102-
D8B6AD971B58D45F005CDDB2 /* libc++.dylib */,
10397
D8B6ACE61B583877005CDDB2 /* Foundation.framework */,
10498
D8C579BB1B5837DF00899F86 /* UIKit.framework */,
10599
);
@@ -114,13 +108,15 @@
114108
D8B6ACEC1B583C33005CDDB2 /* FirebaseArray.h */,
115109
D8B6ACED1B583C33005CDDB2 /* FirebaseDataSource.h */,
116110
D8B6ACEE1B583C33005CDDB2 /* FirebaseTableViewDataSource.h */,
111+
D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */,
117112
);
118113
name = API;
119114
sourceTree = "<group>";
120115
};
121116
D8B6ACEA1B5839F7005CDDB2 /* Implementation */ = {
122117
isa = PBXGroup;
123118
children = (
119+
D8DF55611B742DB40030E996 /* FirebaseCollectionViewDataSource.m */,
124120
D8B6ACEF1B583C41005CDDB2 /* FirebaseArray.m */,
125121
D8B6ACF21B583C41005CDDB2 /* FirebaseDataSource.m */,
126122
D8B6ACF11B583C41005CDDB2 /* FirebaseTableViewDataSource.m */,
@@ -165,6 +161,7 @@
165161
D8B6ACF91B583D3E005CDDB2 /* FirebaseDataSource.h in Headers */,
166162
D8784C401B719F280025587E /* FirebaseArrayDelegate.h in Headers */,
167163
D8124F431B72B347003441AD /* FirebaseTableViewDataSource.h in Headers */,
164+
D8DA10F11B7AC50400D00954 /* FirebaseCollectionViewDataSource.h in Headers */,
168165
D8B6ACFB1B583D48005CDDB2 /* FirebaseArray.h in Headers */,
169166
);
170167
runOnlyForDeploymentPostprocessing = 0;
@@ -240,7 +237,7 @@
240237
);
241238
runOnlyForDeploymentPostprocessing = 0;
242239
shellPath = /bin/sh;
243-
shellScript = "# Using the default Ray Wenderlich build script http://www.raywenderlich.com/65964/create-a-framework-for-ios\nset -e\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n\n# Copy the public headers into the framework\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\"";
240+
shellScript = "set -e\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n\n# Copy the public headers into the framework\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\"";
244241
};
245242
D8B6ADA91B58DCF9005CDDB2 /* MultiPlatform Build */ = {
246243
isa = PBXShellScriptBuildPhase;
@@ -263,6 +260,7 @@
263260
isa = PBXSourcesBuildPhase;
264261
buildActionMask = 2147483647;
265262
files = (
263+
D8DF55621B742DB40030E996 /* FirebaseCollectionViewDataSource.m in Sources */,
266264
D8B6ACF61B583C41005CDDB2 /* FirebaseDataSource.m in Sources */,
267265
D8B6ACF31B583C41005CDDB2 /* FirebaseArray.m in Sources */,
268266
D8124F421B72B344003441AD /* FirebaseTableViewDataSource.m in Sources */,
@@ -283,6 +281,7 @@
283281
D8B6ADA51B58DCDD005CDDB2 /* Debug */ = {
284282
isa = XCBuildConfiguration;
285283
buildSettings = {
284+
CLANG_MODULES_AUTOLINK = YES;
286285
OTHER_LDFLAGS = "";
287286
PRODUCT_NAME = "$(TARGET_NAME)";
288287
};
@@ -291,6 +290,7 @@
291290
D8B6ADA61B58DCDD005CDDB2 /* Release */ = {
292291
isa = XCBuildConfiguration;
293292
buildSettings = {
293+
CLANG_MODULES_AUTOLINK = YES;
294294
OTHER_LDFLAGS = "";
295295
PRODUCT_NAME = "$(TARGET_NAME)";
296296
};
@@ -377,17 +377,19 @@
377377
D8C579B01B57349000899F86 /* Debug */ = {
378378
isa = XCBuildConfiguration;
379379
buildSettings = {
380+
CLANG_MODULES_AUTOLINK = YES;
380381
DEAD_CODE_STRIPPING = NO;
382+
DEFINES_MODULE = YES;
381383
FRAMEWORK_SEARCH_PATHS = (
384+
"$(SDKROOT)/Developer/Library/Frameworks",
382385
"$(inherited)",
383-
"$(PROJECT_DIR)/sdk",
384386
"$(DEVELOPER_FRAMEWORKS_DIR)",
385-
"$(SDKROOT)/Developer/Library/Frameworks",
387+
"$(PROJECT_DIR)/sdk",
386388
);
387389
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
388390
GCC_WARN_PEDANTIC = YES;
389391
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
390-
OTHER_LDFLAGS = "-ObjC";
392+
OTHER_LDFLAGS = "";
391393
PRODUCT_NAME = "$(TARGET_NAME)";
392394
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)";
393395
SKIP_INSTALL = YES;
@@ -398,17 +400,19 @@
398400
D8C579B11B57349000899F86 /* Release */ = {
399401
isa = XCBuildConfiguration;
400402
buildSettings = {
403+
CLANG_MODULES_AUTOLINK = YES;
401404
DEAD_CODE_STRIPPING = NO;
405+
DEFINES_MODULE = YES;
402406
FRAMEWORK_SEARCH_PATHS = (
407+
"$(SDKROOT)/Developer/Library/Frameworks",
403408
"$(inherited)",
404-
"$(PROJECT_DIR)/sdk",
405409
"$(DEVELOPER_FRAMEWORKS_DIR)",
406-
"$(SDKROOT)/Developer/Library/Frameworks",
410+
"$(PROJECT_DIR)/sdk",
407411
);
408412
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
409413
GCC_WARN_PEDANTIC = YES;
410414
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
411-
OTHER_LDFLAGS = "-ObjC";
415+
OTHER_LDFLAGS = "";
412416
PRODUCT_NAME = "$(TARGET_NAME)";
413417
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)";
414418
SKIP_INSTALL = YES;

FirebaseUI/API/FirebaseArray.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232

3333
@class FQuery;
3434
@class Firebase;
35+
@class FDataSnapshot;
3536

37+
/**
38+
* FirebaseArray provides an array structure that is synchronized with a Firebase reference or query. It is useful for building custom data structures or sources, and provides the base for FirebaseDataSource.
39+
*/
3640
@interface FirebaseArray : NSObject
3741

3842
/**
@@ -48,7 +52,7 @@
4852
/**
4953
* The delegate object that array changes are surfaced to.
5054
*/
51-
@property (strong, nonatomic) NSMutableArray *snapshots;
55+
@property (strong, nonatomic) NSMutableArray<FDataSnapshot *> *snapshots;
5256

5357
#pragma mark -
5458
#pragma mark Initializer methods
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/*
2+
* Firebase UI Bindings iOS Library
3+
*
4+
* Copyright © 2015 Firebase - All Rights Reserved
5+
* https://www.firebase.com
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binaryform must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR
18+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20+
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT,
21+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
*/
28+
29+
#import <UIKit/UIKit.h>
30+
31+
#import "FirebaseDataSource.h"
32+
33+
@class Firebase;
34+
35+
/**
36+
* FirebaseCollectionViewDataSource provides an class that conforms to the UICollcetionViewDataSource protocol which allows UICollectionViews to implement FirebaseCollectionViewDataSource in order to provide a UICollectionView synchronized to a Firebase reference or query. In addition to handling all Firebase child events (added, changed, removed, moved), FirebaseCollectionViewDataSource handles UITableViewCell creation, either with the default UICollectionViewCell, prototype cells, custom UICollectionViewCell subclasses, or custom XIBs, and provides a simple [FirebaseCollectionViewDataSource populateCellWithBlock:] method which allows developers to populate the cells created for them with desired data from Firebase.
37+
*/
38+
@interface FirebaseCollectionViewDataSource : FirebaseDataSource <UICollectionViewDataSource>
39+
40+
/**
41+
* The model class to coerce FDataSnapshots to (if desired). For instance, if the modelClass is set to [Message class] in Obj-C or Message.self in Swift, then objects of type Message will be returned instead of type FDataSnapshot.
42+
*/
43+
@property (strong, nonatomic, nonnull) Class modelClass;
44+
45+
/**
46+
* The reuse identifier for cells in the UICollectionView.
47+
*/
48+
@property (strong, nonatomic, nonnull) NSString *reuseIdentifier;
49+
50+
/**
51+
* The UICollectionView instance that operations (inserts, removals, moves, etc.) are performed against.
52+
*/
53+
@property (strong, nonatomic, nonnull) UICollectionView *collectionView;
54+
55+
/**
56+
* The callback to populate a subclass of UICollectionViewCell with an object provided by the datasource.
57+
*/
58+
@property (strong, nonatomic, nonnull) void(^populateCell)(__nonnull __kindof UICollectionViewCell *cell, __nonnull __kindof NSObject *object);
59+
60+
/**
61+
* Initialize an instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with FDataSnapshots.
62+
* @param ref A Firebase reference to bind the datasource to
63+
* @param identifier A string to use as a CellReuseIdentifier
64+
* @param collectionView An instance of a UICollectionView to bind to
65+
* @return An instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with FDataSnapshots
66+
*/
67+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
68+
69+
/**
70+
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with FDataSnapshots.
71+
* @param ref A Firebase reference to bind the datasource to
72+
* @param cell A subclass of UICollectionViewCell used to populate the UICollectionView, defaults to UICollectionViewCell if nil
73+
* @param identifier A string to use as a CellReuseIdentifier
74+
* @param collectionView An instance of a UICollectionView to bind to
75+
* @return An instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with FDataSnapshots
76+
*/
77+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
78+
79+
/**
80+
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom xib with FDataSnapshots.
81+
* @param ref A Firebase reference to bind the datasource to
82+
* @param nibName The name of a xib file to create the layout for a UICollectionViewCell
83+
* @param identifier A string to use as a CellReuseIdentifier
84+
* @param collectionView An instance of a UICollectionView to bind to
85+
* @return An instance of FirebaseCollectionViewDataSource that populates a custom xib with FDataSnapshots
86+
*/
87+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
88+
89+
/**
90+
* Initialize an instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with a custom model class.
91+
* @param ref A Firebase reference to bind the datasource to
92+
* @param model A custom class that FDataSnapshots are coerced to, defaults to FDataSnapshot if nil
93+
* @param identifier A string to use as a CellReuseIdentifier
94+
* @param collectionView An instance of a UICollectionView to bind to
95+
* @return An instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with a custom model class
96+
*/
97+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
98+
99+
/**
100+
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with a custom model class.
101+
* @param ref A Firebase reference to bind the datasource to
102+
* @param model A custom class that FDataSnapshots are coerced to, defaults to FDataSnapshot if nil
103+
* @param cell A subclass of UICollectionViewCell used to populate the UICollectionView, defaults to UICollectionViewCell if nil
104+
* @param identifier A string to use as a CellReuseIdentifier
105+
* @param collectionView An instance of a UICollectionView to bind to
106+
* @return An instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with a custom model class
107+
*/
108+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
109+
110+
/**
111+
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom xib with a custom model class.
112+
* @param ref A Firebase reference to bind the datasource to
113+
* @param model A custom class that FDataSnapshots are coerced to, defaults to FDataSnapshot if nil
114+
* @param nibName The name of a xib file to create the layout for a UICollectionViewCell
115+
* @param identifier A string to use as a CellReuseIdentifier
116+
* @param collectionView An instance of a UICollectionView to bind to
117+
* @return An instance of FirebaseCollectionViewDataSource that populates a custom xib with a custom model class
118+
*/
119+
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
120+
121+
/**
122+
* This method populates the fields of a UICollectionViewCell or subclass given an FDataSnapshot (or custom model object).
123+
* @param callback A block which returns an initialized UICollectionViewCell (or subclass) and the corresponding object to populate the cell with.
124+
*/
125+
- (void)populateCellWithBlock:(nonnull void(^)(__nonnull __kindof UICollectionViewCell *cell, __nonnull __kindof NSObject *object))callback;
126+
127+
@end

0 commit comments

Comments
 (0)