Skip to content

Commit d70d220

Browse files
authored
Merge 26dccd1 into 7d88965
2 parents 7d88965 + 26dccd1 commit d70d220

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Ignore SwiftUI's list background decoration view in redaction ([#6292](https://github.com/getsentry/sentry-cocoa/pull/6292))
8+
39
## 8.56.2
410

511
### Fixes

Sources/Swift/Core/Tools/ViewCapture/SentryUIRedactBuilder.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ final class SentryUIRedactBuilder {
1818
/// causes a crash due to unimplemented init(layer:) initializer.
1919
private static let cameraSwiftUIViewClassId = "CameraUI.ChromeSwiftUIView"
2020

21+
/// Class identifier for ``_UICollectionViewListLayoutSectionBackgroundColorDecorationView``, if it exists.
22+
///
23+
/// This object identifier is used to identify views of this class type during the redaction process.
24+
/// This workaround is required because SwiftUI's List view uses this class to display the background color
25+
/// with it expanding way beyond the bounds of the list.
26+
private static let collectionViewListLayoutSectionBackgroundColorDecorationViewClassId = "_UICollectionViewListLayoutSectionBackgroundColorDecorationView" // swiftlint:disable:this identifier_name
27+
28+
// MARK: - Properties
29+
2130
///This is a wrapper which marks it's direct children to be ignored
2231
private var ignoreContainerClassIdentifier: ObjectIdentifier?
2332

@@ -338,6 +347,13 @@ final class SentryUIRedactBuilder {
338347
// This crash only occurs when building with Xcode 16 for iOS 26, so we add a runtime check
339348
return true
340349
}
350+
351+
if viewTypeId == Self.collectionViewListLayoutSectionBackgroundColorDecorationViewClassId {
352+
// _UICollectionViewListLayoutSectionBackgroundColorDecorationView is a special case because it is used by the SwiftUI.List view to display the background color.
353+
//
354+
// We need to ignore it because it causes issues in the redaction clipping process.
355+
return true
356+
}
341357
return false
342358
}
343359

0 commit comments

Comments
 (0)