Skip to content

Commit

Permalink
Merge pull request #35 from getditto/UpdateReadME
Browse files Browse the repository at this point in the history
Update ReadMe
  • Loading branch information
texasRanger09 authored Feb 18, 2023
2 parents 22b5f74 + 1204e00 commit f69d8b7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Binary file modified Img/collections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ The Ditto Data Browser allows you to view all your collections, documents within
<img src="/Img/collections.png" alt="Collections Image" width="300">

<img src="/Img/document.png" alt="Document Image" width="300">

**Standalone App**
If you are using the Data Browser as a standalone app, there is a button, `Start Subscriptions`, you must press in order to start syncing data.
If you are embedding the Data Browser into another application then you do not need to press `Start Subscriptions` as you should already have your subscriptions running.

First, make sure the "DittoDataBrowser" was added to your Target.
Then, use `import DittoDataBrowser` to import the Data Browser.
Then, use `import DittoDataBrowser` to import the Data Browser.

**SwiftUI**

Expand All @@ -87,7 +91,16 @@ struct DataBrowserView: View {
DataBrowser(ditto: DittoManager.shared.ditto)
}
}
```

**UIKit**

Pass `DataBrowser(ditto: Ditto)` to a [UIHostingController](https://sarunw.com/posts/swiftui-in-uikit/) which will return a view controller that you can use to present.
```
let vc = UIHostingController(rootView: DataBrowser(ditto: DittoManager.shared.ditto))
present(vc, animated: true)
```

### 3. Export Logs
Export Logs allows you to export a file of the logs from your applcation.
Expand All @@ -104,7 +117,16 @@ Use `ExportLogs()` to export the logs. It is reccomended to call `ExportLogs` fr
.sheet(isPresented: $exportLogs) {
ExportLogs()
}
```

**UIKit**

Pass `ExportLogs()` to a [UIHostingController](https://sarunw.com/posts/swiftui-in-uikit/) which will return a view controller that you can use to present.
```
let vc = UIHostingController(rootView: ExportLogs())
present(vc, animated: true)
```

### 4. Disk Usage

Expand All @@ -126,7 +148,16 @@ struct DiskUsageViewer: View {
DittoDiskUsageView(ditto: DittoManager.shared.ditto)
}
}
```

**UIKit**

Pass `DittoDiskUsageView(ditto: Ditto)` to a [UIHostingController](https://sarunw.com/posts/swiftui-in-uikit/) which will return a view controller that you can use to present.
```
let vc = UIHostingController(rootView: DittoDiskUsageView(ditto: DittoManager.shared.ditto))
present(vc, animated: true)
```

## Contact

Expand Down

0 comments on commit f69d8b7

Please sign in to comment.