SDK Setup Guides
...
Quick Tips for Swift
DittoSwiftTools
dittoswifttools are diagnostic tools for ditto you can view connected peers, export debug logs, browse collections (documents), and monitor ditto's disk usage requirements https //legacydocs ditto live/ios/quick tips/dittoswifttools#requirements ios 15 0+ swift 5 0+ installation https //legacydocs ditto live/ios/quick tips/dittoswifttools#installation the recommended approach to using dittoswifttools in your project is using the swift package manager with your project open in xcode go to file > add packages, then search using "github com/getditto/dittoswifttools" to find the dittoswifttools package select "add package" select which dittoswifttools products you would like, then select "add package" if you are looking for compatibility with ditto v4, please target the https //github com/getditto/dittoswifttools/tree/v4 in the swift package manager usage https //legacydocs ditto live/ios/quick tips/dittoswifttools#usage there are four targets in this package presence viewer, data browser, export logs, disk usage presence viewer the presence viewer displays a mesh graph that allows you to see all connected peers within the mesh and the transport that each peer is using to make a connection first, make sure the dittopresenceviewer was added to your target then, use import dittopresenceviewer to import the presenceviewer you can use the presence viewer in siwftui or uikit swiftui use presenceview(ditto ditto) and pass in your ditto instance to display the mesh graph swift import dittopresenceviewer struct presenceviewer view{ var body some view { presenceview(ditto dittomanager shared ditto) } } uikit call present , pass the following as a parameter, and then set animated to true dittopresenceview(ditto\ dittomanager shared ditto) viewcontroller swift func tableview( tableview uitableview, didselectrowat indexpath indexpath) { present(dittopresenceview(ditto dittomanager shared ditto) viewcontroller, animated true) { if let selected = tableview\ indexpathforselectedrow { tableview\ deselectrow(at selected, animated true) } } } data browser the ditto data browser allows you to view all your documents within each collection, including each document's fields with the data browser, you can observe any changes that are made to your collections and documents in realtime 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 swiftui use databrowser(ditto ditto) and pass in your ditto instance to display the data browser swift import dittodatabrowser struct databrowserview view { var body some view { databrowser(ditto dittomanager shared ditto) } } uikit pass databrowser(ditto ditto) to a https //sarunw\ com/posts/swiftui in uikit/ which will return a view controller that you can use to present swift let vc = uihostingcontroller(rootview databrowser(ditto dittomanager shared ditto)) present(vc, animated true) export logs export logs allows you to export a file of the logs from your app first, make sure the "dittoexportlogs" was added to your target then, use import dittoexportlogs to import the export logs swiftui use exportlogs() to export the logs it is recommended to call exportlogs from within a https //developer apple com/documentation/swiftui/view/sheet(ispresented\ ondismiss\ content ) swift sheet(ispresented $exportlogs) { exportlogs() } uikit pass exportlogs() to a https //sarunw\ com/posts/swiftui in uikit/ which will return a view controller that you can use to present swift let vc = uihostingcontroller(rootview exportlogs()) present(vc, animated true) disk usage disk usage allows you to see ditto's file space usage first, make sure the "dittodiskusage" was added to your target then, use import dittodiskusage to import the disk usage first, make sure the "dittodiskusage" was added to your target then, use import dittodiskusage to import the disk usage swiftui use dittodiskusageview(ditto ditto) and pass in your ditto instance import dittodiskusage struct diskusageviewer view { var body some view { dittodiskusageview(ditto dittomanager shared ditto) } } uikit pass dittodiskusageview(ditto ditto) to a 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)