-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(isHittable): check if view is hittable from first responder.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// UIResponder+First.h | ||
// Detox | ||
// | ||
// Created by Asaf Korem on 02/12/2021. | ||
// Copyright © 2021 Wix. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface UIResponder (First) | ||
|
||
+ (instancetype)dtx_first; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// UIResponder+First.m | ||
// Detox | ||
// | ||
// Created by Asaf Korem on 02/12/2021. | ||
// Copyright © 2021 Wix. All rights reserved. | ||
// | ||
|
||
#import "UIResponder+First.h" | ||
|
||
static __weak UIResponder *_dtx_first; | ||
|
||
@implementation UIResponder (First) | ||
|
||
+ (instancetype)dtx_first { | ||
_dtx_first = nil; | ||
[[UIApplication sharedApplication] sendAction:@selector(responderAction:) to:nil from:nil | ||
forEvent:nil]; | ||
return _dtx_first; | ||
} | ||
|
||
- (void)responderAction:(id)sender { | ||
_dtx_first = self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters