Merge pull request #674 from adly-holler/editable-text-assert-viewbacked

Assert that ASEditableTextNode stays view-backed
This commit is contained in:
appleguy 2015-09-22 13:51:16 -07:00
commit 7dbb07161f
2 changed files with 10 additions and 1 deletions

View File

@ -11,7 +11,10 @@
@protocol ASEditableTextNodeDelegate;
/// @abstract ASEditableTextNode implements a node that supports text editing.
/**
@abstract Implements a node that supports text editing.
@discussion Does not support layer backing.
*/
@interface ASEditableTextNode : ASDisplayNode
// @abstract The text node's delegate, which must conform to the <ASEditableTextNodeDelegate> protocol.

View File

@ -188,6 +188,12 @@
_placeholderTextKitComponents.textView.opaque = opaque;
}
- (void)setLayerBacked:(BOOL)layerBacked
{
ASDisplayNodeAssert(!layerBacked, @"Cannot set layerBacked to YES on ASEditableTextNode instances must be view-backed in order to ensure touch events can be passed to the internal UITextView during editing.");
[super setLayerBacked:layerBacked];
}
#pragma mark - Configuration
@synthesize delegate = _delegate;