diff --git a/Tusker/Swizzler.h b/Tusker/Swizzler.h index 7733ec63..7740f6f3 100644 --- a/Tusker/Swizzler.h +++ b/Tusker/Swizzler.h @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN -#if !TARGET_OS_VISION @interface Swizzler : NSObject + (BOOL)swizzleStatusBarManagerWithExceptionHandler:(void (^)(NSException *))captureException; @@ -37,6 +36,5 @@ NS_SWIFT_UI_ACTOR - (void)handleTapAction:(id)sender; @end -#endif NS_ASSUME_NONNULL_END diff --git a/Tusker/Swizzler.m b/Tusker/Swizzler.m index f21e1e2b..2f903ad3 100644 --- a/Tusker/Swizzler.m +++ b/Tusker/Swizzler.m @@ -12,6 +12,7 @@ @implementation Swizzler + (BOOL)swizzleStatusBarManagerWithExceptionHandler:(void (^)(NSException *))captureException { + #if !TARGET_OS_VISION __block IMP original; IMP new = imp_implementationWithBlock(^void (UIStatusBarManager *self, id sender) { if ([self.windowScene.delegate conformsToProtocol:@protocol(StatusBarTapHandling)]) { @@ -32,6 +33,9 @@ }); original = class_replaceMethod(UIStatusBarManager.class, @selector(handleTapAction:), new, "v@:@"); return original != nil; + #else + return YES; + #endif } @end