Skip to content

Commit 75898b3

Browse files
initial files
1 parent 4088582 commit 75898b3

File tree

15 files changed

+1041
-18
lines changed

15 files changed

+1041
-18
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Build generated
2+
build/
3+
DerivedData/
4+
5+
xcuserdata/
6+
.DS_Store
7+
8+
RealTimeChat/GoogleService-Info.plist
9+
~

RealTimeChat.xcodeproj/project.pbxproj

Lines changed: 128 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,52 @@
66
objectVersion = 77;
77
objects = {
88

9+
/* Begin PBXBuildFile section */
10+
E889F7D52DA8991600202556 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7D12DA8991600202556 /* ContentView.swift */; };
11+
E889F7D62DA8991600202556 /* RealTimeChatApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7D32DA8991600202556 /* RealTimeChatApp.swift */; };
12+
E889F7D72DA8991600202556 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E889F7D02DA8991600202556 /* Assets.xcassets */; };
13+
E889F7D82DA8991600202556 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E889F7D22DA8991600202556 /* GoogleService-Info.plist */; };
14+
E889F7DB2DA899E600202556 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = E889F7DA2DA899E600202556 /* FirebaseAuth */; };
15+
E889F7DD2DA899E600202556 /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = E889F7DC2DA899E600202556 /* FirebaseCore */; };
16+
E889F7DF2DA899E600202556 /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = E889F7DE2DA899E600202556 /* FirebaseFirestore */; };
17+
E889F7E12DA899E600202556 /* FirebaseStorage in Frameworks */ = {isa = PBXBuildFile; productRef = E889F7E02DA899E600202556 /* FirebaseStorage */; };
18+
E889F7E32DA89BB600202556 /* DatabaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7E22DA89BB600202556 /* DatabaseManager.swift */; };
19+
E889F7E52DA8BA9000202556 /* ChatroomsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7E42DA8BA9000202556 /* ChatroomsView.swift */; };
20+
E889F7E72DA9FE0A00202556 /* RTCEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7E62DA9FE0A00202556 /* RTCEmptyView.swift */; };
21+
E889F7E92DAAE36300202556 /* CreateChatroomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7E82DAAE36300202556 /* CreateChatroomView.swift */; };
22+
E889F7EB2DAAF01600202556 /* RTCActionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7EA2DAAF01600202556 /* RTCActionButton.swift */; };
23+
E889F7EE2DAAF51700202556 /* ChatroomRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7ED2DAAF51700202556 /* ChatroomRowView.swift */; };
24+
E889F7F02DAAF73D00202556 /* ChatroomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7EF2DAAF73D00202556 /* ChatroomView.swift */; };
25+
E889F7F22DAB05B200202556 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7F12DAB05B200202556 /* Model.swift */; };
26+
E889F7F52DAB0AA900202556 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E889F7F42DAB0AA900202556 /* Constants.swift */; };
27+
/* End PBXBuildFile section */
28+
929
/* Begin PBXFileReference section */
1030
E889F7C02DA8989300202556 /* RealTimeChat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RealTimeChat.app; sourceTree = BUILT_PRODUCTS_DIR; };
31+
E889F7D02DA8991600202556 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
32+
E889F7D12DA8991600202556 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
33+
E889F7D22DA8991600202556 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
34+
E889F7D32DA8991600202556 /* RealTimeChatApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealTimeChatApp.swift; sourceTree = "<group>"; };
35+
E889F7E22DA89BB600202556 /* DatabaseManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseManager.swift; sourceTree = "<group>"; };
36+
E889F7E42DA8BA9000202556 /* ChatroomsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatroomsView.swift; sourceTree = "<group>"; };
37+
E889F7E62DA9FE0A00202556 /* RTCEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTCEmptyView.swift; sourceTree = "<group>"; };
38+
E889F7E82DAAE36300202556 /* CreateChatroomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateChatroomView.swift; sourceTree = "<group>"; };
39+
E889F7EA2DAAF01600202556 /* RTCActionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RTCActionButton.swift; sourceTree = "<group>"; };
40+
E889F7ED2DAAF51700202556 /* ChatroomRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatroomRowView.swift; sourceTree = "<group>"; };
41+
E889F7EF2DAAF73D00202556 /* ChatroomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatroomView.swift; sourceTree = "<group>"; };
42+
E889F7F12DAB05B200202556 /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
43+
E889F7F42DAB0AA900202556 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
1144
/* End PBXFileReference section */
1245

13-
/* Begin PBXFileSystemSynchronizedRootGroup section */
14-
E889F7C22DA8989300202556 /* RealTimeChat */ = {
15-
isa = PBXFileSystemSynchronizedRootGroup;
16-
path = RealTimeChat;
17-
sourceTree = "<group>";
18-
};
19-
/* End PBXFileSystemSynchronizedRootGroup section */
20-
2146
/* Begin PBXFrameworksBuildPhase section */
2247
E889F7BD2DA8989300202556 /* Frameworks */ = {
2348
isa = PBXFrameworksBuildPhase;
2449
buildActionMask = 2147483647;
2550
files = (
51+
E889F7DD2DA899E600202556 /* FirebaseCore in Frameworks */,
52+
E889F7E12DA899E600202556 /* FirebaseStorage in Frameworks */,
53+
E889F7DB2DA899E600202556 /* FirebaseAuth in Frameworks */,
54+
E889F7DF2DA899E600202556 /* FirebaseFirestore in Frameworks */,
2655
);
2756
runOnlyForDeploymentPostprocessing = 0;
2857
};
@@ -32,7 +61,7 @@
3261
E889F7B72DA8989300202556 = {
3362
isa = PBXGroup;
3463
children = (
35-
E889F7C22DA8989300202556 /* RealTimeChat */,
64+
E889F7D42DA8991600202556 /* RealTimeChat */,
3665
E889F7C12DA8989300202556 /* Products */,
3766
);
3867
sourceTree = "<group>";
@@ -45,6 +74,42 @@
4574
name = Products;
4675
sourceTree = "<group>";
4776
};
77+
E889F7D42DA8991600202556 /* RealTimeChat */ = {
78+
isa = PBXGroup;
79+
children = (
80+
E889F7F12DAB05B200202556 /* Model.swift */,
81+
E889F7F42DAB0AA900202556 /* Constants.swift */,
82+
E889F7E22DA89BB600202556 /* DatabaseManager.swift */,
83+
E889F7D32DA8991600202556 /* RealTimeChatApp.swift */,
84+
E889F7D12DA8991600202556 /* ContentView.swift */,
85+
E889F7F32DAB05D100202556 /* Components */,
86+
E889F7EC2DAAF4FE00202556 /* Chatrooms */,
87+
E889F7D22DA8991600202556 /* GoogleService-Info.plist */,
88+
E889F7D02DA8991600202556 /* Assets.xcassets */,
89+
);
90+
path = RealTimeChat;
91+
sourceTree = "<group>";
92+
};
93+
E889F7EC2DAAF4FE00202556 /* Chatrooms */ = {
94+
isa = PBXGroup;
95+
children = (
96+
E889F7E42DA8BA9000202556 /* ChatroomsView.swift */,
97+
E889F7E82DAAE36300202556 /* CreateChatroomView.swift */,
98+
E889F7ED2DAAF51700202556 /* ChatroomRowView.swift */,
99+
E889F7EF2DAAF73D00202556 /* ChatroomView.swift */,
100+
);
101+
path = Chatrooms;
102+
sourceTree = "<group>";
103+
};
104+
E889F7F32DAB05D100202556 /* Components */ = {
105+
isa = PBXGroup;
106+
children = (
107+
E889F7E62DA9FE0A00202556 /* RTCEmptyView.swift */,
108+
E889F7EA2DAAF01600202556 /* RTCActionButton.swift */,
109+
);
110+
path = Components;
111+
sourceTree = "<group>";
112+
};
48113
/* End PBXGroup section */
49114

50115
/* Begin PBXNativeTarget section */
@@ -60,11 +125,12 @@
60125
);
61126
dependencies = (
62127
);
63-
fileSystemSynchronizedGroups = (
64-
E889F7C22DA8989300202556 /* RealTimeChat */,
65-
);
66128
name = RealTimeChat;
67129
packageProductDependencies = (
130+
E889F7DA2DA899E600202556 /* FirebaseAuth */,
131+
E889F7DC2DA899E600202556 /* FirebaseCore */,
132+
E889F7DE2DA899E600202556 /* FirebaseFirestore */,
133+
E889F7E02DA899E600202556 /* FirebaseStorage */,
68134
);
69135
productName = RealTimeChat;
70136
productReference = E889F7C02DA8989300202556 /* RealTimeChat.app */;
@@ -94,6 +160,9 @@
94160
);
95161
mainGroup = E889F7B72DA8989300202556;
96162
minimizedProjectReferenceProxies = 1;
163+
packageReferences = (
164+
E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
165+
);
97166
preferredProjectObjectVersion = 77;
98167
productRefGroup = E889F7C12DA8989300202556 /* Products */;
99168
projectDirPath = "";
@@ -109,6 +178,8 @@
109178
isa = PBXResourcesBuildPhase;
110179
buildActionMask = 2147483647;
111180
files = (
181+
E889F7D72DA8991600202556 /* Assets.xcassets in Resources */,
182+
E889F7D82DA8991600202556 /* GoogleService-Info.plist in Resources */,
112183
);
113184
runOnlyForDeploymentPostprocessing = 0;
114185
};
@@ -119,6 +190,17 @@
119190
isa = PBXSourcesBuildPhase;
120191
buildActionMask = 2147483647;
121192
files = (
193+
E889F7EE2DAAF51700202556 /* ChatroomRowView.swift in Sources */,
194+
E889F7F52DAB0AA900202556 /* Constants.swift in Sources */,
195+
E889F7E72DA9FE0A00202556 /* RTCEmptyView.swift in Sources */,
196+
E889F7F02DAAF73D00202556 /* ChatroomView.swift in Sources */,
197+
E889F7D52DA8991600202556 /* ContentView.swift in Sources */,
198+
E889F7E52DA8BA9000202556 /* ChatroomsView.swift in Sources */,
199+
E889F7F22DAB05B200202556 /* Model.swift in Sources */,
200+
E889F7D62DA8991600202556 /* RealTimeChatApp.swift in Sources */,
201+
E889F7EB2DAAF01600202556 /* RTCActionButton.swift in Sources */,
202+
E889F7E32DA89BB600202556 /* DatabaseManager.swift in Sources */,
203+
E889F7E92DAAE36300202556 /* CreateChatroomView.swift in Sources */,
122204
);
123205
runOnlyForDeploymentPostprocessing = 0;
124206
};
@@ -324,6 +406,40 @@
324406
defaultConfigurationName = Release;
325407
};
326408
/* End XCConfigurationList section */
409+
410+
/* Begin XCRemoteSwiftPackageReference section */
411+
E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
412+
isa = XCRemoteSwiftPackageReference;
413+
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
414+
requirement = {
415+
kind = upToNextMajorVersion;
416+
minimumVersion = 11.11.0;
417+
};
418+
};
419+
/* End XCRemoteSwiftPackageReference section */
420+
421+
/* Begin XCSwiftPackageProductDependency section */
422+
E889F7DA2DA899E600202556 /* FirebaseAuth */ = {
423+
isa = XCSwiftPackageProductDependency;
424+
package = E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
425+
productName = FirebaseAuth;
426+
};
427+
E889F7DC2DA899E600202556 /* FirebaseCore */ = {
428+
isa = XCSwiftPackageProductDependency;
429+
package = E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
430+
productName = FirebaseCore;
431+
};
432+
E889F7DE2DA899E600202556 /* FirebaseFirestore */ = {
433+
isa = XCSwiftPackageProductDependency;
434+
package = E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
435+
productName = FirebaseFirestore;
436+
};
437+
E889F7E02DA899E600202556 /* FirebaseStorage */ = {
438+
isa = XCSwiftPackageProductDependency;
439+
package = E889F7D92DA899E600202556 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
440+
productName = FirebaseStorage;
441+
};
442+
/* End XCSwiftPackageProductDependency section */
327443
};
328444
rootObject = E889F7B82DA8989300202556 /* Project object */;
329445
}

RealTimeChat.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// ChatroomRowView.swift
3+
// RealTimeChat
4+
//
5+
// Created by Justin Wong on 4/12/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ChatroomRowView: View {
11+
@Environment(DatabaseManager.self) private var databaseManager
12+
13+
var chatroom: RTCChatroom
14+
15+
var body: some View {
16+
VStack(alignment: .leading) {
17+
Text(databaseManager.getChatroomFormattedParticipantsString(for: chatroom.participantIDs))
18+
.font(.subheadline)
19+
.fontWeight(.semibold)
20+
Spacer()
21+
Text(chatroom.getMostRecentMessage())
22+
.font(.system(size: 14))
23+
.foregroundStyle(.gray)
24+
Spacer()
25+
}
26+
.frame(height: 50)
27+
}
28+
}
29+
30+
#Preview {
31+
let chatroom = RTCChatroom(participantIDs: ["7nqoUyXIApbQAaBxwx6Pb9pzMjw1", "QuZIQIKoLwX1o2qlStPyELqkfe63"], messages: [])
32+
ChatroomRowView(chatroom: chatroom)
33+
.environment(DatabaseManager())
34+
}

0 commit comments

Comments
 (0)