NSAttributedString(Extensions) Category Reference
Declared in | NSAttributedString+Extensions.h |
---|
+ attributedStringWithString:
Creates a new NSAttributedString
.
+ (nonnull NSAttributedString *)attributedStringWithString:(nonnull NSString *)string
Parameters
string |
The character string. |
---|
Return Value
The NSAttributedString
object.
Discussion
Creates a new NSAttributedString
.
Declared In
NSAttributedString+Extensions.h
+ attributedStringWithString:attributes:
Creates a new NSAttributedString
.
+ (nonnull NSAttributedString *)attributedStringWithString:(nonnull NSString *)string attributes:(nullable NSDictionary<NSString*,id> *)attributes
Parameters
string |
The character string. |
---|---|
attributes |
The attributes to be applied to the string. |
Return Value
The NSAttributedString
object.
Discussion
Creates a new NSAttributedString
.
Declared In
NSAttributedString+Extensions.h
– sizeWithContainer:
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
- (CGSize)sizeWithContainer:(CGSize)container
Parameters
container |
The size in which attempt to fit the text. |
---|
Return Value
The CGSize
required to render.
Discussion
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
Declared In
NSAttributedString+Extensions.h
– sizeWithContainer:lineBreakMode:
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
- (CGSize)sizeWithContainer:(CGSize)container lineBreakMode:(NSLineBreakMode)lineBreakMode
Parameters
container |
The size in which attempt to fit the text. |
---|---|
lineBreakMode |
The |
Return Value
The CGSize
required to render.
Discussion
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
Declared In
NSAttributedString+Extensions.h
– sizeWithContainer:lineBreakMode:padding:
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
- (CGSize)sizeWithContainer:(CGSize)container lineBreakMode:(NSLineBreakMode)lineBreakMode padding:(UIEdgeInsets)padding
Parameters
container |
The size in which attempt to fit the text. |
---|---|
lineBreakMode |
The |
padding |
The padding to apply to the container before calculating. |
Return Value
The CGSize
required to render.
Discussion
Calculates the CGSize
that would be required to render this NSAttributedString
given the container CGSize
.
Declared In
NSAttributedString+Extensions.h