Skip to content

Commit c93f05c

Browse files
committed
fix failing build in objc sample
1 parent 7656d64 commit c93f05c

File tree

2 files changed

+37
-113
lines changed

2 files changed

+37
-113
lines changed

samples/objc/FirebaseUI-demo-objc.xcodeproj/project.pbxproj

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
2EBAE127DEBD66C58E245B21 /* libPods-FirebaseUI-demo-objc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 938FB9FC77F663938FE622D6 /* libPods-FirebaseUI-demo-objc.a */; };
1110
8D7D5DC11D9D9536006C1857 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8D7D5DC01D9D9536006C1857 /* GoogleService-Info.plist */; };
1211
8D7F86B51D9DAA0100C2A122 /* FIRStorageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D7F86B41D9DAA0100C2A122 /* FIRStorageViewController.m */; };
1312
C329B1B21DAD6E5100059A13 /* FIRCustomEmailEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C329B1B01DAD6E5100059A13 /* FIRCustomEmailEntryViewController.m */; };
@@ -39,12 +38,9 @@
3938
/* End PBXBuildFile section */
4039

4140
/* Begin PBXFileReference section */
42-
598B087699EFBC1BE0B36A92 /* Pods-FirebaseUI-demo-objc.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FirebaseUI-demo-objc.release.xcconfig"; path = "Pods/Target Support Files/Pods-FirebaseUI-demo-objc/Pods-FirebaseUI-demo-objc.release.xcconfig"; sourceTree = "<group>"; };
43-
647B80EEA828EC06543AD749 /* Pods-FirebaseUI-demo-objc.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FirebaseUI-demo-objc.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FirebaseUI-demo-objc/Pods-FirebaseUI-demo-objc.debug.xcconfig"; sourceTree = "<group>"; };
4441
8D7D5DC01D9D9536006C1857 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
4542
8D7F86B31D9DAA0100C2A122 /* FIRStorageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FIRStorageViewController.h; path = Storage/FIRStorageViewController.h; sourceTree = "<group>"; };
4643
8D7F86B41D9DAA0100C2A122 /* FIRStorageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FIRStorageViewController.m; path = Storage/FIRStorageViewController.m; sourceTree = "<group>"; };
47-
938FB9FC77F663938FE622D6 /* libPods-FirebaseUI-demo-objc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FirebaseUI-demo-objc.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4844
C329B1AF1DAD6E5100059A13 /* FIRCustomEmailEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRCustomEmailEntryViewController.h; sourceTree = "<group>"; };
4945
C329B1B01DAD6E5100059A13 /* FIRCustomEmailEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRCustomEmailEntryViewController.m; sourceTree = "<group>"; };
5046
C329B1B11DAD6E5100059A13 /* FIRCustomEmailEntryViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FIRCustomEmailEntryViewController.xib; sourceTree = "<group>"; };
@@ -95,30 +91,12 @@
9591
isa = PBXFrameworksBuildPhase;
9692
buildActionMask = 2147483647;
9793
files = (
98-
2EBAE127DEBD66C58E245B21 /* libPods-FirebaseUI-demo-objc.a in Frameworks */,
9994
);
10095
runOnlyForDeploymentPostprocessing = 0;
10196
};
10297
/* End PBXFrameworksBuildPhase section */
10398

10499
/* Begin PBXGroup section */
105-
3CEA8AFFCA922D2EE7184ACF /* Frameworks */ = {
106-
isa = PBXGroup;
107-
children = (
108-
938FB9FC77F663938FE622D6 /* libPods-FirebaseUI-demo-objc.a */,
109-
);
110-
name = Frameworks;
111-
sourceTree = "<group>";
112-
};
113-
73A50C19F323688E38D93693 /* Pods */ = {
114-
isa = PBXGroup;
115-
children = (
116-
647B80EEA828EC06543AD749 /* Pods-FirebaseUI-demo-objc.debug.xcconfig */,
117-
598B087699EFBC1BE0B36A92 /* Pods-FirebaseUI-demo-objc.release.xcconfig */,
118-
);
119-
name = Pods;
120-
sourceTree = "<group>";
121-
};
122100
8D7D5DC51D9DA075006C1857 /* Storage */ = {
123101
isa = PBXGroup;
124102
children = (
@@ -189,8 +167,6 @@
189167
8D7D5DC01D9D9536006C1857 /* GoogleService-Info.plist */,
190168
D81A05F21B86A78700498183 /* FirebaseUI-demo-objc */,
191169
D81A05F11B86A78700498183 /* Products */,
192-
73A50C19F323688E38D93693 /* Pods */,
193-
3CEA8AFFCA922D2EE7184ACF /* Frameworks */,
194170
);
195171
sourceTree = "<group>";
196172
};
@@ -236,12 +212,9 @@
236212
isa = PBXNativeTarget;
237213
buildConfigurationList = D81A06131B86A78700498183 /* Build configuration list for PBXNativeTarget "FirebaseUI-demo-objc" */;
238214
buildPhases = (
239-
6108EB0AB9E416E4AE3984D7 /* [CP] Check Pods Manifest.lock */,
240215
D81A05EC1B86A78700498183 /* Sources */,
241216
D81A05ED1B86A78700498183 /* Frameworks */,
242217
D81A05EE1B86A78700498183 /* Resources */,
243-
810D75511A2A731AA4CCE556 /* [CP] Embed Pods Frameworks */,
244-
9D09D152A3C8575E8465B6B5 /* [CP] Copy Pods Resources */,
245218
);
246219
buildRules = (
247220
);
@@ -305,54 +278,6 @@
305278
};
306279
/* End PBXResourcesBuildPhase section */
307280

308-
/* Begin PBXShellScriptBuildPhase section */
309-
6108EB0AB9E416E4AE3984D7 /* [CP] Check Pods Manifest.lock */ = {
310-
isa = PBXShellScriptBuildPhase;
311-
buildActionMask = 2147483647;
312-
files = (
313-
);
314-
inputPaths = (
315-
);
316-
name = "[CP] Check Pods Manifest.lock";
317-
outputPaths = (
318-
);
319-
runOnlyForDeploymentPostprocessing = 0;
320-
shellPath = /bin/sh;
321-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
322-
showEnvVarsInLog = 0;
323-
};
324-
810D75511A2A731AA4CCE556 /* [CP] Embed Pods Frameworks */ = {
325-
isa = PBXShellScriptBuildPhase;
326-
buildActionMask = 2147483647;
327-
files = (
328-
);
329-
inputPaths = (
330-
);
331-
name = "[CP] Embed Pods Frameworks";
332-
outputPaths = (
333-
);
334-
runOnlyForDeploymentPostprocessing = 0;
335-
shellPath = /bin/sh;
336-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FirebaseUI-demo-objc/Pods-FirebaseUI-demo-objc-frameworks.sh\"\n";
337-
showEnvVarsInLog = 0;
338-
};
339-
9D09D152A3C8575E8465B6B5 /* [CP] Copy Pods Resources */ = {
340-
isa = PBXShellScriptBuildPhase;
341-
buildActionMask = 2147483647;
342-
files = (
343-
);
344-
inputPaths = (
345-
);
346-
name = "[CP] Copy Pods Resources";
347-
outputPaths = (
348-
);
349-
runOnlyForDeploymentPostprocessing = 0;
350-
shellPath = /bin/sh;
351-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FirebaseUI-demo-objc/Pods-FirebaseUI-demo-objc-resources.sh\"\n";
352-
showEnvVarsInLog = 0;
353-
};
354-
/* End PBXShellScriptBuildPhase section */
355-
356281
/* Begin PBXSourcesBuildPhase section */
357282
D81A05EC1B86A78700498183 /* Sources */ = {
358283
isa = PBXSourcesBuildPhase;
@@ -483,7 +408,6 @@
483408
};
484409
D81A06141B86A78700498183 /* Debug */ = {
485410
isa = XCBuildConfiguration;
486-
baseConfigurationReference = 647B80EEA828EC06543AD749 /* Pods-FirebaseUI-demo-objc.debug.xcconfig */;
487411
buildSettings = {
488412
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
489413
INFOPLIST_FILE = "FirebaseUI-demo-objc/Info.plist";
@@ -495,7 +419,6 @@
495419
};
496420
D81A06151B86A78700498183 /* Release */ = {
497421
isa = XCBuildConfiguration;
498-
baseConfigurationReference = 598B087699EFBC1BE0B36A92 /* Pods-FirebaseUI-demo-objc.release.xcconfig */;
499422
buildSettings = {
500423
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
501424
INFOPLIST_FILE = "FirebaseUI-demo-objc/Info.plist";

samples/objc/FirebaseUI-demo-objc/Samples/Chat/FIRChatViewController.m

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,44 @@ - (void)viewDidLoad {
2929

3030
self.ref = [[FIRDatabase database].reference child:@"objc_demo-chat"];
3131

32+
NSString *identifier = @"cellReuseIdentifier";
33+
UINib *nib = [UINib nibWithNibName:@"FIRChatMessageTableViewCell" bundle:nil];
34+
[self.tableView registerNib:nib forCellReuseIdentifier:identifier];
3235
self.dataSource =
33-
[[FIRChatMessageDataSource alloc] initWithRef:self.ref
34-
modelClass:[FIRChatMessage class]
35-
nibNamed:@"FIRChatMessageTableViewCell"
36-
cellReuseIdentifier:@"cellReuseIdentifier"
37-
view:self.tableView];
38-
39-
[self.dataSource
40-
populateCellWithBlock:^void(FIRChatMessageTableViewCell *__nonnull cell,
41-
FIRChatMessage *__nonnull message) {
42-
43-
if ([message.uid isEqualToString:[FIRAuth auth].currentUser.uid]) {
44-
cell.myMessageLabel.text = message.text;
45-
cell.myNameLabel.text = message.name;
46-
cell.myNameLabel.textColor = [UIColor colorWithRed:164.0 / 255.0
47-
green:199.0 / 255.0
48-
blue:57.0 / 255.0
49-
alpha:1.0];
50-
[cell.myMessageLabel setHidden:NO];
51-
[cell.myNameLabel setHidden:NO];
52-
[cell.otherMessageLabel setHidden:YES];
53-
[cell.otherNameLabel setHidden:YES];
54-
} else {
55-
cell.otherMessageLabel.text = message.text;
56-
cell.otherNameLabel.text = message.name;
57-
cell.otherNameLabel.textColor = [UIColor colorWithRed:164.0 / 255.0
58-
green:199.0 / 255.0
59-
blue:57.0 / 255.0
60-
alpha:1.0];
61-
[cell.otherMessageLabel setHidden:NO];
62-
[cell.otherNameLabel setHidden:NO];
63-
[cell.myMessageLabel setHidden:YES];
64-
[cell.myNameLabel setHidden:YES];
65-
66-
}
67-
68-
}];
36+
[[FIRChatMessageDataSource alloc] initWithQuery:self.ref
37+
view:self.tableView
38+
populateCell:^UITableViewCell *(UITableView *tableView,
39+
NSIndexPath *indexPath,
40+
FIRDataSnapshot *snap) {
41+
FIRChatMessage *message = [[FIRChatMessage alloc] initWithName:snap.value[@"name"]
42+
andText:snap.value[@"text"]
43+
userId:snap.value[@"uid"]];
44+
FIRChatMessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
45+
if ([message.uid isEqualToString:[FIRAuth auth].currentUser.uid]) {
46+
cell.myMessageLabel.text = message.text;
47+
cell.myNameLabel.text = message.name;
48+
cell.myNameLabel.textColor = [UIColor colorWithRed:164.0 / 255.0
49+
green:199.0 / 255.0
50+
blue:57.0 / 255.0
51+
alpha:1.0];
52+
[cell.myMessageLabel setHidden:NO];
53+
[cell.myNameLabel setHidden:NO];
54+
[cell.otherMessageLabel setHidden:YES];
55+
[cell.otherNameLabel setHidden:YES];
56+
} else {
57+
cell.otherMessageLabel.text = message.text;
58+
cell.otherNameLabel.text = message.name;
59+
cell.otherNameLabel.textColor = [UIColor colorWithRed:164.0 / 255.0
60+
green:199.0 / 255.0
61+
blue:57.0 / 255.0
62+
alpha:1.0];
63+
[cell.otherMessageLabel setHidden:NO];
64+
[cell.otherNameLabel setHidden:NO];
65+
[cell.myMessageLabel setHidden:YES];
66+
[cell.myNameLabel setHidden:YES];
67+
}
68+
return cell;
69+
}];
6970

7071
self.tableView.dataSource = self.dataSource;
7172
self.tableView.delegate = self;

0 commit comments

Comments
 (0)