mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[ASTextKitComponents] Make sure Main Thread Checker isn't triggered during background calculations #trivial (#612)
* Add unit test * Make sure TextKit components can calculate size in background without upsetting Main Thread Checker - Add a new thread-safe text view bounds. - Temporary components stack doesn't have a text view so it can be safely deallocated off main. * Add ASTextKitComponentsTextView * Remove unnecessary change * Fix minor mistake * ASTextKitComponentsTextView has only 1 initializer * Minor change * Switch to atomic property * Remove manual synthesization
This commit is contained in:
@@ -20,6 +20,12 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASTextKitComponentsTextView : UITextView
|
||||
- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder __unavailable;
|
||||
- (instancetype)init __unavailable;
|
||||
@end
|
||||
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASTextKitComponents : NSObject
|
||||
|
||||
@@ -52,14 +58,13 @@ AS_SUBCLASSING_RESTRICTED
|
||||
*/
|
||||
- (CGSize)sizeForConstrainedWidth:(CGFloat)constrainedWidth;
|
||||
|
||||
|
||||
- (CGSize)sizeForConstrainedWidth:(CGFloat)constrainedWidth
|
||||
forMaxNumberOfLines:(NSInteger)numberOfLines;
|
||||
|
||||
@property (nonatomic, strong, readonly) NSTextStorage *textStorage;
|
||||
@property (nonatomic, strong, readonly) NSTextContainer *textContainer;
|
||||
@property (nonatomic, strong, readonly) NSLayoutManager *layoutManager;
|
||||
@property (nonatomic, strong, nullable) UITextView *textView;
|
||||
@property (nonatomic, strong, nullable) ASTextKitComponentsTextView *textView;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user