[ASEditableTextNode] Maximum number of lines to display (#2777) (#2867)

* WIP

* Calculate TextKit Height based on max lines to display

* Remove TODO

* Calculate height based on lineFragmentRect

* Fixes issue with calculated width

* Resolve TextKit stack threading issues

* Removes blank lines

* Open brace on next line

* setNeedsLayout in case of changes on live node
This commit is contained in:
Leo Tumwattana
2017-01-13 05:47:44 +08:00
committed by Adlai Holler
parent daa12a867e
commit 4e80acc6e1
5 changed files with 97 additions and 7 deletions

View File

@@ -44,6 +44,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (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;