Swizzling
The Cocoa SDK uses swizzling to provide some features out of the box without boilerplate code. The following features use swizzling:
macOS
- Breadcrumbs for touch events
- Auto instrumentation for HTTP requests
- Automatically added sentry-trace header to HTTP requests for distributed tracing
iOS, tvOS and Catalyst
- Breadcrumbs for touch events and navigation with UIViewControllers
- Auto instrumentation for UIViewControllers
- Auto instrumentation for HTTP requests
- Automatically added sentry-trace header to HTTP requests for distributed tracing
Since Cocoa 7.5.0, you can opt out of swizzling using options. When you disable swizzling, the SDK disables the features above:
Copied
import Sentry
SentrySDK.start { options in
options.dsn = "https://examplePublicKey@o0.ingest.sentry.io/0"
options.enableSwizzling = false
}
- Package:
- cocoapods:sentry-cocoa
- Version:
- 8.32.0
- Repository:
- https://github.com/getsentry/sentry-cocoa