mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Standardize Property Declaration Style in Core Classes (#870)
* Audit property attributes for core classes * Update style guide * Go crazy * Update changelog
This commit is contained in:
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@discussion Defaults to nil, no text is shown.
|
||||
For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedText;
|
||||
@property (nullable, copy) NSAttributedString *attributedText;
|
||||
|
||||
#pragma mark - Truncation
|
||||
|
||||
@@ -34,37 +34,37 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@abstract The attributedText to use when the text must be truncated.
|
||||
@discussion Defaults to a localized ellipsis character.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedText;
|
||||
@property (nullable, copy) NSAttributedString *truncationAttributedText;
|
||||
|
||||
/**
|
||||
@summary The second attributed string appended for truncation.
|
||||
@discussion This string will be highlighted on touches.
|
||||
@default nil
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *additionalTruncationMessage;
|
||||
@property (nullable, copy) NSAttributedString *additionalTruncationMessage;
|
||||
|
||||
/**
|
||||
@abstract Determines how the text is truncated to fit within the receiver's maximum size.
|
||||
@discussion Defaults to NSLineBreakByWordWrapping.
|
||||
@note Setting a truncationMode in attributedString will override the truncation mode set here.
|
||||
*/
|
||||
@property (nonatomic, assign) NSLineBreakMode truncationMode;
|
||||
@property NSLineBreakMode truncationMode;
|
||||
|
||||
/**
|
||||
@abstract If the text node is truncated. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTruncated) BOOL truncated;
|
||||
@property (readonly, getter=isTruncated) BOOL truncated;
|
||||
|
||||
/**
|
||||
@abstract The maximum number of lines to render of the text before truncation.
|
||||
@default 0 (No limit)
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger maximumNumberOfLines;
|
||||
@property NSUInteger maximumNumberOfLines;
|
||||
|
||||
/**
|
||||
@abstract The number of lines in the text. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSUInteger lineCount;
|
||||
@property (readonly) NSUInteger lineCount;
|
||||
|
||||
/**
|
||||
* An array of path objects representing the regions where text should not be displayed.
|
||||
@@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* the text node's bounds. You can use this property to have text wrap around images,
|
||||
* shapes or other text like a fancy magazine.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
@property (nullable, copy) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
|
||||
#pragma mark - Placeholders
|
||||
|
||||
@@ -85,27 +85,27 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* following the true shape of the text's wrapping. This visually mirrors the overall
|
||||
* shape and weight of paragraphs, making the appearance of the finished text less jarring.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL placeholderEnabled;
|
||||
@property BOOL placeholderEnabled;
|
||||
|
||||
/**
|
||||
@abstract The placeholder color.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||
@property (nullable, copy) UIColor *placeholderColor;
|
||||
|
||||
/**
|
||||
@abstract Inset each line of the placeholder.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets placeholderInsets;
|
||||
@property UIEdgeInsets placeholderInsets;
|
||||
|
||||
#pragma mark - Shadow
|
||||
|
||||
/**
|
||||
@abstract When you set these ASDisplayNode properties, they are composited into the bitmap instead of being applied by CA.
|
||||
|
||||
@property (nonatomic, assign) CGColorRef shadowColor;
|
||||
@property (nonatomic, assign) CGFloat shadowOpacity;
|
||||
@property (nonatomic, assign) CGSize shadowOffset;
|
||||
@property (nonatomic, assign) CGFloat shadowRadius;
|
||||
@property (nonatomic) CGColorRef shadowColor;
|
||||
@property (nonatomic) CGFloat shadowOpacity;
|
||||
@property (nonatomic) CGSize shadowOffset;
|
||||
@property (nonatomic) CGFloat shadowRadius;
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
UIEdgeInsetsRect(boundingRectForText, shadowPadding)
|
||||
will return a CGRect large enough to fit both the text and the appropriate shadow padding.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) UIEdgeInsets shadowPadding;
|
||||
@property (nonatomic, readonly) UIEdgeInsets shadowPadding;
|
||||
|
||||
#pragma mark - Positioning
|
||||
|
||||
@@ -175,12 +175,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract The style to use when highlighting text.
|
||||
*/
|
||||
@property (nonatomic, assign) ASTextNodeHighlightStyle highlightStyle;
|
||||
@property (nonatomic) ASTextNodeHighlightStyle highlightStyle;
|
||||
|
||||
/**
|
||||
@abstract The range of text highlighted by the receiver. Changes to this property are not animated by default.
|
||||
*/
|
||||
@property (nonatomic, assign) NSRange highlightRange;
|
||||
@property (nonatomic) NSRange highlightRange;
|
||||
|
||||
/**
|
||||
@abstract Set the range of text to highlight, with optional animation.
|
||||
@@ -197,17 +197,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
textNode:longPressedLinkAttribute:value:atPoint:textRange: in order for
|
||||
the long press gesture recognizer to be installed.
|
||||
*/
|
||||
@property (atomic, weak) id<ASTextNodeDelegate> delegate;
|
||||
@property (weak) id<ASTextNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
@abstract If YES and a long press is recognized, touches are cancelled. Default is NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL longPressCancelsTouches;
|
||||
@property (nonatomic) BOOL longPressCancelsTouches;
|
||||
|
||||
/**
|
||||
@abstract if YES will not intercept touches for non-link areas of the text. Default is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL passthroughNonlinkTouches;
|
||||
@property (nonatomic) BOOL passthroughNonlinkTouches;
|
||||
|
||||
+ (void)enableDebugging;
|
||||
|
||||
@@ -215,9 +215,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASTextNode2 (Unavailable)
|
||||
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user