Skip to content

Commit

Permalink
feat(apple): Add docs for swizzleClassNameExcludes
Browse files Browse the repository at this point in the history
Add docs for the existing option swizzleClassNameExcludes.
  • Loading branch information
philipphofmann committed Aug 6, 2024
1 parent 11a095f commit e5668b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs/platforms/apple/common/configuration/swizzling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ SentrySDK.start { options in
To skip swizzling specific classes, you can use the option `swizzleClassNameExcludes`, which is available with Sentry Cocoa SDK version `8.23.0` and above. The SDK checks if the class name of a class to swizzle contains a class name of this option. For example, if you add MyUIViewController to this list, the Sentry Cocoa SDK excludes the following classes from swizzling:
- YourApp.MyUIViewController,
- YourApp.MyUIViewControllerA
- MyApp.MyUIViewController
- `YourApp.MyUIViewController`
- `YourApp.MyUIViewControllerA`
- `MyApp.MyUIViewController`
```swift
```swift {tabTitle:Swift}
import Sentry
SentrySDK.start { options in
options.swizzleClassNameExcludes = [
"MyUIViewController",
Expand All @@ -67,6 +69,8 @@ SentrySDK.start { options in
```

```objc {tabTitle:Objective-C}
@import Sentry;

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.swizzleClassNameExcludes = [NSSet setWithObjects:
@"MyUIViewController",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ SentrySDK.start { options in
You can disable UIViewController tracing for specific UIViewControllers by using the option <PlatformLink to="/configuration/swizzling#skip-swizzling-for-specific-classes">`swizzleClassNameExcludes`</PlatformLink>:
```swift
```swift {tabTitle:Swift}
import Sentry
SentrySDK.start { options in
options.swizzleClassNameExcludes = [
"MyUIViewController",
Expand All @@ -70,6 +72,8 @@ SentrySDK.start { options in
```

```objc {tabTitle:Objective-C}
@import Sentry;

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.swizzleClassNameExcludes = [NSSet setWithObjects:
@"MyUIViewController",
Expand Down

0 comments on commit e5668b3

Please sign in to comment.