Add support for textContainerInset to ASTextNode (ala UITextView) (#2062)

* Add support for textContainerInset to ASTextNode (ala UITextView)

* Better comment, parens to increase readability. Thanks @schneider!

* Add textContainerInset snapshot test.
This commit is contained in:
Garrett Moon
2016-08-12 12:07:00 -07:00
committed by Adlai Holler
parent 39cb188b9e
commit 2c9e51e8f7
4 changed files with 95 additions and 4 deletions

View File

@@ -31,6 +31,14 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, nonatomic, copy) NSTextStorage * (^textStorageCreationBlock)(NSAttributedString *_Nullable attributedString);
/**
@abstract Text margins for text laid out in the text node.
@discussion defaults to UIEdgeInsetsZero.
This property can be useful for handling text which does not fit within the view by default. An example: like UILabel,
ASTextNode will clip the left and right of the string "judar" if it's rendered in an italicised font.
*/
@property (nonatomic, assign) UIEdgeInsets textContainerInset;
@end
NS_ASSUME_NONNULL_END