Skip to content

Commit 98f6c7d

Browse files
committed
adding placeholder UI implementing list and buttons for main view
1 parent 44826ce commit 98f6c7d

File tree

4 files changed

+91
-23
lines changed

4 files changed

+91
-23
lines changed

firestore/FirestoreExample.xcodeproj/project.pbxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
8E4C62D325E9CFE0001678A1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E4C62D225E9CFE0001678A1 /* ContentView.swift */; };
2828
8E4C62D525E9CFE1001678A1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8E4C62D425E9CFE1001678A1 /* Assets.xcassets */; };
2929
8E4C62D825E9CFE1001678A1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8E4C62D725E9CFE1001678A1 /* Preview Assets.xcassets */; };
30+
8E4C62E725E9D191001678A1 /* RestaurantItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E4C62E625E9D191001678A1 /* RestaurantItemView.swift */; };
3031
928F7382D38D4F9DB48A15EF /* Pods_FirestoreExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 541C1C9953818121C760549F /* Pods_FirestoreExample.framework */; };
3132
DE8564AE23AFBF8000611383 /* FirestoreUITest.m in Sources */ = {isa = PBXBuildFile; fileRef = DE8564AD23AFBF8000611383 /* FirestoreUITest.m */; };
3233
DE8564B423AFBFA700611383 /* FIREGSignInHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = DE8564B123AFBFA700611383 /* FIREGSignInHelper.m */; };
@@ -83,6 +84,7 @@
8384
8E4C62D425E9CFE1001678A1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8485
8E4C62D725E9CFE1001678A1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
8586
8E4C62D925E9CFE1001678A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
87+
8E4C62E625E9D191001678A1 /* RestaurantItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestaurantItemView.swift; sourceTree = "<group>"; };
8688
D3859CC2659F6A304C12A137 /* Pods-FirestoreExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FirestoreExample.release.xcconfig"; path = "Target Support Files/Pods-FirestoreExample/Pods-FirestoreExample.release.xcconfig"; sourceTree = "<group>"; };
8789
DE8564AC23AFBF8000611383 /* FirestoreExampleUITests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FirestoreExampleUITests-Bridging-Header.h"; sourceTree = "<group>"; };
8890
DE8564AD23AFBF8000611383 /* FirestoreUITest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirestoreUITest.m; sourceTree = "<group>"; };
@@ -207,8 +209,8 @@
207209
8E4C62CF25E9CFE0001678A1 /* FirestoreSwiftUIExample */ = {
208210
isa = PBXGroup;
209211
children = (
212+
8E4C62E125E9D137001678A1 /* Views */,
210213
8E4C62D025E9CFE0001678A1 /* FirestoreSwiftUIExampleApp.swift */,
211-
8E4C62D225E9CFE0001678A1 /* ContentView.swift */,
212214
8E4C62D425E9CFE1001678A1 /* Assets.xcassets */,
213215
8E4C62D925E9CFE1001678A1 /* Info.plist */,
214216
8E4C62D625E9CFE1001678A1 /* Preview Content */,
@@ -224,6 +226,15 @@
224226
path = "Preview Content";
225227
sourceTree = "<group>";
226228
};
229+
8E4C62E125E9D137001678A1 /* Views */ = {
230+
isa = PBXGroup;
231+
children = (
232+
8E4C62D225E9CFE0001678A1 /* ContentView.swift */,
233+
8E4C62E625E9D191001678A1 /* RestaurantItemView.swift */,
234+
);
235+
path = Views;
236+
sourceTree = "<group>";
237+
};
227238
DE8564AF23AFBFA700611383 /* TestUtils */ = {
228239
isa = PBXGroup;
229240
children = (
@@ -573,6 +584,7 @@
573584
files = (
574585
8E4C62D325E9CFE0001678A1 /* ContentView.swift in Sources */,
575586
8E4C62D125E9CFE0001678A1 /* FirestoreSwiftUIExampleApp.swift in Sources */,
587+
8E4C62E725E9D191001678A1 /* RestaurantItemView.swift in Sources */,
576588
);
577589
runOnlyForDeploymentPostprocessing = 0;
578590
};

firestore/FirestoreSwiftUIExample/ContentView.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// ContentView.swift
3+
// FirestoreSwiftUIExample
4+
//
5+
// Created by Rachel Collins on 2/26/21.
6+
// Copyright © 2021 Firebase. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct ContentView: View {
12+
var body: some View {
13+
NavigationView {
14+
List(/*@START_MENU_TOKEN@*/0 ..< 5/*@END_MENU_TOKEN@*/) { item in
15+
NavigationLink(destination: RestaurantDetailView()) {
16+
RestaurantItemView()
17+
}
18+
}
19+
.navigationBarTitle("Friendly Eats", displayMode: .inline)
20+
.toolbar {
21+
ToolbarItem(placement: .navigationBarLeading) {
22+
Button("Populate") {
23+
print("populating")
24+
}
25+
}
26+
27+
ToolbarItem(placement: .navigationBarTrailing) {
28+
Button("Filter") {
29+
print("filtering")
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
struct ContentView_Previews: PreviewProvider {
37+
static var previews: some View {
38+
ContentView()
39+
}
40+
}
41+
42+
struct RestaurantDetailView: View {
43+
var body: some View {
44+
Text("Detail View Placeholder")
45+
}
46+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// RestaurantView.swift
3+
// FirestoreSwiftUIExample
4+
//
5+
// Created by Rachel Collins on 2/26/21.
6+
// Copyright © 2021 Firebase. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct RestaurantItemView: View {
12+
var body: some View {
13+
HStack {
14+
Image(systemName: "circle")
15+
VStack(alignment: .leading) {
16+
Text("Restaurant Name")
17+
Text("Star Placeholder")
18+
Spacer()
19+
Text("Type and location")
20+
}
21+
Spacer()
22+
Text("$$$")
23+
}
24+
.padding([.leading, .bottom, .trailing])
25+
}
26+
}
27+
28+
struct RestaurantItemView_Previews: PreviewProvider {
29+
static var previews: some View {
30+
RestaurantItemView()
31+
}
32+
}

0 commit comments

Comments
 (0)