Fix compiling on visionOS
This commit is contained in:
parent
874d2588f8
commit
883f9a3cb2
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user