diff --git a/docs/platforms/apple/guides/ios/session-replay/customredact.mdx b/docs/platforms/apple/guides/ios/session-replay/customredact.mdx index cbce45af422dc..7e9f435a507b1 100644 --- a/docs/platforms/apple/guides/ios/session-replay/customredact.mdx +++ b/docs/platforms/apple/guides/ios/session-replay/customredact.mdx @@ -21,8 +21,8 @@ You can choose which type of view you want to mask or unmask by using the `maske Let's say you have a custom view that you want to mask and a `UILabel` subclass (which normally would be masked) that you don't want to mask. You can set the options like this: ```swift - options.sessionReplay.maskedViewClasses = [MyCustomView.self] - options.sessionReplay.unmaskedViewClasses = [MyCustomLabel.self] +options.sessionReplay.maskedViewClasses = [MyCustomView.self] +options.sessionReplay.unmaskedViewClasses = [MyCustomLabel.self] ``` ## Mask by View Instance @@ -30,15 +30,15 @@ Let's say you have a custom view that you want to mask and a `UILabel` subclass You can also choose to mask or unmask a specific view instance by using the replay API (`SentrySDK.replay`) or view extensions like this: ```swift - SentrySDK.replay.maskView(view: view) - SentrySDK.replay.unmaskView(view: label) +SentrySDK.replay.maskView(view: view) +SentrySDK.replay.unmaskView(view: label) ``` or ```swift - view.sentryReplayMask() - label.sentryReplayUnmask() +view.sentryReplayMask() +label.sentryReplayUnmask() ``` ## SwiftUI @@ -49,32 +49,32 @@ In order to control the SwiftUI masking process, you need to use the `sentryRepl In this example we want to show the message, but not the user name. ```swift - @Binding var user: String - - var body: some View { - VStack { - Text("Hello") - .sentryReplayUnmask() - Text("\(user)") - } +@Binding var user: String + +var body: some View { + VStack { + Text("Hello") + .sentryReplayUnmask() + Text("\(user)") } +} ``` In this example, we need to unmask the VStack because its background element will be masked by default. To hide the username, we need to mask it. ```swift - @Binding var user: String - - var body: some View { - VStack { - Text("Hello") - Text("\(user)") - .sentryReplayMask() - } - .background(.blue) - .sentryReplayUnmask() +@Binding var user: String + +var body: some View { + VStack { + Text("Hello") + Text("\(user)") + .sentryReplayMask() } + .background(.blue) + .sentryReplayUnmask() +} ``` ## Debugging Session Replay masking @@ -82,13 +82,13 @@ To hide the username, we need to mask it. To see how elements are being masked, enable the masking preview from anywhere in your app. It will display an overlay on top of the masked elements. This works on the simulator and on device, as well as within Xcode Preview. ```swift - SentrySDK.replay.showMaskPreview() +SentrySDK.replay.showMaskPreview() ``` By default, the overlay will be opaque. To configure the opacity, pass the desired opacity as a parameter: ```swift - SentrySDK.replay.showMaskPreview(0.5) // 0.5 opacity to render the preview semi-transparent +SentrySDK.replay.showMaskPreview(0.5) // 0.5 opacity to render the preview semi-transparent ``` Make sure not accidentally include this in your release build by e.g. wrapping it in a `#if DEBUG` block.