mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add main thread warnings and setter/getter assert
This commit is contained in:
@@ -19,7 +19,10 @@
|
||||
|
||||
#pragma mark - Configuration
|
||||
|
||||
//! @abstract Access to underlying UITextView for more configuration options.
|
||||
/**
|
||||
@abstract Access to underlying UITextView for more configuration options.
|
||||
@warning This property should only be used on the main thread and should not be accessed before the editable text node's view is created.
|
||||
*/
|
||||
@property (nonatomic, readwrite, strong) UITextView *textView;
|
||||
|
||||
//! @abstract The attributes to apply to new text being entered by the user.
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
{
|
||||
@private
|
||||
// Configuration.
|
||||
UITextView *_textView;
|
||||
NSDictionary *_typingAttributes;
|
||||
|
||||
// Core.
|
||||
@@ -134,7 +135,7 @@
|
||||
[self.view addSubview:_placeholderTextKitComponents.textView];
|
||||
|
||||
// Create and configure our text view.
|
||||
_textKitComponents.textView = _textView;
|
||||
_textKitComponents.textView = _textView;
|
||||
//_textKitComponents.textView = NO; // Unfortunately there's a bug here with iOS 7 DP5 that causes the text-view to only be one line high when scrollEnabled is NO. rdar://14729288
|
||||
_textKitComponents.textView.delegate = self;
|
||||
_textKitComponents.textView.editable = YES;
|
||||
@@ -189,6 +190,21 @@
|
||||
#pragma mark - Configuration
|
||||
@synthesize delegate = _delegate;
|
||||
|
||||
#pragma mark -
|
||||
@dynamic textView;
|
||||
|
||||
- (UITextView *)textView{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
return _textView;
|
||||
}
|
||||
|
||||
- (void)setTextView:(UITextView *)textView
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
_textView = textView;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
@dynamic typingAttributes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user