Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons #2317

Merged
merged 2 commits into from Sep 8, 2020
Merged

Buttons #2317

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions detox/ios/Detox/DetoxManager.swift
Expand Up @@ -362,6 +362,10 @@ public class DetoxManager : NSObject, WebSocketDelegate {
}
return
case "reactNativeReload":
if ReactNativeSupport.isReactNativeApp == false {
self.sendGeneralReadyMessage()
return
}
isReady = false
EarlGrey().detox_safeExecuteSync {
ReactNativeSupport.reloadApp()
Expand Down
16 changes: 16 additions & 0 deletions detox/ios/Detox/Utilities/UIView+DetoxUtils.m
Expand Up @@ -233,6 +233,22 @@ - (BOOL)dtx_isHittableAtPoint:(CGPoint)point error:(NSError* __strong *)error
return [segmentControl dtx_isHittableAtPoint:[segmentControl convertPoint:point fromView:self] error:error];
}

if([self isKindOfClass:NSClassFromString(@"UIButtonLabel")])
{
UIView* button = (id)self;
while(button != nil && [button isKindOfClass:UIButton.class] == NO)
{
button = (id)button.superview;
}

if([button isKindOfClass:NSClassFromString(@"_UIModernBarButton")] && button.userInteractionEnabled == NO && [button.superview isKindOfClass:NSClassFromString(@"_UIButtonBarButton")])
{
button = (id)button.superview;
}

return [button dtx_isHittableAtPoint:[button convertPoint:point fromView:self] error:error];
}

if([self isKindOfClass:UILabel.class] && [self.dtx_containingViewController isKindOfClass:UIAlertController.class])
{
return YES;
Expand Down