Appearance
iOS and macOS (Swift)
Install
In Xcode, File → Add Package Dependencies… and add the SimpleDataLogs library. Until the public launch the package comes with your invitation as a local package (Add Local…, pick the package folder).
Add it
swift
import SimpleDataLogs
// At launch, e.g. in your App's init:
SimpleDataLogs.configure(ingestKey: "sdl_pub_…", autocapture: .all)
// Anywhere:
SimpleDataLogs.track("screenshot_taken", properties: ["type": "area"])Send everything, or only what you choose
- Everything:
autocapture: .allsends launches, sessions and crashes. - Pick:
autocapture: [.sessions, .crashes]. - Only your own events: leave
autocaptureout.
Screen views are opt-in per screen:
swift
SettingsView()
.trackScreenView("Settings")In the first minute
session_startandapp_launched(withis_first_launch) as soon as the app starts.- Every event carries a
session_id;session_end(withduration_s) follows once the app has been away 30 minutes. - After a crash from an uncaught
NSException,app_crashedwithexception_name,reasonandstackon the next launch.
Autocapture defaults
| Option | With .all |
|---|---|
.appLaunches | on |
.sessions (iOS foreground/background, macOS activation) | on |
.crashes (uncaught NSException) | on |
| Screen views | per screen, with .trackScreenView or trackScreen(_:) |
Swift traps (fatalError, force unwraps) are not NSExceptions and are not captured. Everything else is in the Swift SDK reference.