Installation
Add the Swift Package and start the SDK.
Add the package
In Xcode, choose File → Add Package Dependencies… and paste the repository URL:
https://github.com/elarbi-allam/DiagnosticSDK.gitAdd the DiagnosticSDK library to your app target.
Start the SDK
Start it as early as possible, in application(_:didFinishLaunchingWithOptions:):
import DiagnosticSDK
@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
private lazy var networkInterceptor = NetworkInterceptor()
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
#if DEBUG
networkInterceptor.start()
#endif
return true
}
}Keep the call inside #if DEBUG. The SDK is a debugging tool and should not ship in App Store builds.
Open the dashboard
Run the app and shake the device (⌃⌘Z in the Simulator), or tap the floating button.