You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Data Connect tools run on your Mac to provide a local development emulator and code generation service.
50
50
51
51
1.**Add New Scheme:** In Xcode's scheme menu, select **New Scheme...**. Choose the **`Start FDC Tools`** target and click OK.
52
-
2.**Set Working Directory:** Edit the new `Start FDC Tools` scheme. Go to **Run \> Options** and check **"Use custom working directory"**. Set this to the root folder of your Xcode project. **Run the Tools:** Select the `Start FDC Tools` scheme with **My Mac** as the destination and click Run (▶). This will open the FDC tools in your web browser.
52
+
2.**Set Working Directory:** Edit the new `Start FDC Tools` scheme. Go to **Run \> Options** and check **"Use custom working directory"**. Set this to the root folder of your Xcode project.
53
+
3.**Run the Tools:** Select the `Start FDC Tools` scheme with **My Mac** as the destination and click Run (▶). This will open the FDC tools in your web browser.
53
54
54
55
### **Step 4: Generate Your Type-Safe Swift SDK**
55
56
@@ -72,9 +73,8 @@ The tools will generate a custom Swift package based on your database schema.
72
73
73
74
In your main app file (the one with `@main`), initialize Firebase and configure Data Connect to use the local emulator.
74
75
75
-
Swift
76
76
77
-
```
77
+
```swift
78
78
// MyApp.swift
79
79
importSwiftUI
80
80
importFirebase
@@ -103,9 +103,7 @@ struct MyApp: App {
103
103
104
104
Now you can write data to the database from any SwiftUI view.
105
105
106
-
Swift
107
-
108
-
```
106
+
```swift
109
107
// ContentView.swift
110
108
importSwiftUI
111
109
importFirebaseDataConnect
@@ -131,16 +129,15 @@ struct ContentView: View {
131
129
}
132
130
```
133
131
134
-
*Note:* You may need to enable `App Sanbbox` -> `Outgoing Connections (Client)` for your Xcode app target to run it from iPhone simulator.
132
+
*Note:* You may need to enable `App Sandbox` -> `Outgoing Connections (Client)` for your Xcode app target to run it from iPhone simulator.
135
133
136
134
137
135
### **Step 7: Execute a Query (Read & Display Data)**
138
136
139
137
Use a `QueryRef` to fetch data and automatically bind it to your SwiftUI view.
0 commit comments