Skip to content

Commit

Permalink
access view first before checking canBecome/Resign responder in becom…
Browse files Browse the repository at this point in the history
…eResponder methods (TextureGroup#829)

* fix SIMULATE_WEB_RESPONSE not imported TextureGroup#449

* Fix to make rangeMode update in right time

* Access view first before check canBecomeFirstResponder.
  • Loading branch information
wsdwsd0829 authored and bernieperez committed Apr 25, 2018
1 parent f8dbec1 commit dc3db8f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1009,12 +1009,12 @@ - (BOOL)__canBecomeFirstResponder

- (BOOL)__becomeFirstResponder
{
// Note: This implicitly loads the view if it hasn't been loaded yet.
[self view];

if (![self canBecomeFirstResponder]) {
return NO;
}

// Note: This implicitly loads the view if it hasn't been loaded yet.
[self view];

HANDLE_NODE_RESPONDER_METHOD(becomeFirstResponder);
}
Expand All @@ -1031,13 +1031,13 @@ - (BOOL)__canResignFirstResponder

- (BOOL)__resignFirstResponder
{
// Note: This implicitly loads the view if it hasn't been loaded yet.
[self view];

if (![self canResignFirstResponder]) {
return NO;
}

// Note: This implicitly loads the view if it hasn't been loaded yet.
[self view];

HANDLE_NODE_RESPONDER_METHOD(resignFirstResponder);
}

Expand Down

0 comments on commit dc3db8f

Please sign in to comment.