mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-05-18 01:02:13 +08:00
Include moved UIResponder methods in UIViewBridging Category Implementation.
This commit is contained in:
@@ -67,6 +67,41 @@
|
||||
*/
|
||||
@implementation ASDisplayNode (UIViewBridge)
|
||||
|
||||
- (BOOL)canBecomeFirstResponder
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)canResignFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)isFirstResponder
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return _view != nil && [_view isFirstResponder];
|
||||
}
|
||||
|
||||
// Note: this implicitly loads the view if it hasn't been loaded yet.
|
||||
- (BOOL)becomeFirstResponder
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return !self.layerBacked && [self canBecomeFirstResponder] && [self.view becomeFirstResponder];
|
||||
}
|
||||
|
||||
- (BOOL)resignFirstResponder
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return !self.layerBacked && [self canResignFirstResponder] && [_view resignFirstResponder];
|
||||
}
|
||||
|
||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return !self.layerBacked && [self.view canPerformAction:action withSender:sender];
|
||||
}
|
||||
|
||||
- (CGFloat)alpha
|
||||
{
|
||||
_bridge_prologue;
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
case _ASHierarchyChangeTypeDelete:
|
||||
return _deleteSectionChanges;
|
||||
default:
|
||||
NSAssert(NO, @"Request for section changes with invalid type: %lu", changeType);
|
||||
NSAssert(NO, @"Request for section changes with invalid type: %lu", (long)changeType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
case _ASHierarchyChangeTypeDelete:
|
||||
return _deleteItemChanges;
|
||||
default:
|
||||
NSAssert(NO, @"Request for item changes with invalid type: %lu", changeType);
|
||||
NSAssert(NO, @"Request for item changes with invalid type: %lu", (long)changeType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user