Skip to content

Commit 8fb37c2

Browse files
docs: restore helper header comments
Restore the four headerdocs this branch had dropped from SentryUIViewControllerSwizzlingHelper.h, and keep the new notes as additions to them rather than replacements. Drop the now-unused _SentryPrivate import from ClearTestState: the helper's stop moved to the swizzling suite's tearDown, so the file no longer references it.
1 parent 4f6d39e commit 8fb37c2

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

SentryTestUtils/Sources/ClearTestState.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@_spi(Private) @testable import Sentry
2-
import _SentryPrivate
32
import Foundation
43

54
public func clearTestState() {

Sources/Sentry/include/SentryUIViewControllerSwizzlingHelper.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@
44

55
NS_ASSUME_NONNULL_BEGIN
66

7+
/**
8+
* Helper class that performs the actual method swizzling for UIViewController tracking.
9+
* This class is used by the Swift SentryUIViewControllerSwizzling class.
10+
*/
711
@interface SentryUIViewControllerSwizzlingHelper : NSObject
812

13+
/**
14+
* Swizzles the base UIViewController methods (loadView) with the provided tracker.
15+
* @param tracker The performance tracker to use for tracking view controller lifecycle events.
16+
*/
917
+ (void)swizzleUIViewControllerWithTracker:(SENTRY_SWIFT_MIGRATION_ID(
1018
SentryUIViewControllerPerformanceTracker))tracker;
1119

20+
/**
21+
* Swizzles a specific UIViewController subclass for performance tracking.
22+
* @param class The UIViewController subclass to swizzle.
23+
*/
1224
+ (void)swizzleViewControllerSubClass:(Class)class;
1325

1426
/**
@@ -29,12 +41,17 @@ NS_ASSUME_NONNULL_BEGIN
2941
# if SENTRY_TEST || SENTRY_TEST_CI
3042

3143
/**
44+
* Unswizzles all UIViewController methods. Only available in test targets.
45+
*
3246
* Restores @c loadView and the two init funnel initializers. Restoring the initializers matters
3347
* because a live base-class IMP outlives the delegate that @c stop clears, so leaving them
3448
* installed leaks the funnel into every later test suite in the same run.
3549
*/
3650
+ (void)unswizzle;
3751

52+
/**
53+
* Returns whether swizzling is currently active. Only available in test targets.
54+
*/
3855
+ (BOOL)swizzlingActive;
3956
# endif
4057

0 commit comments

Comments
 (0)