DTAttributedTextCell Class Reference
Inherits from | UITableViewCell |
Declared in | DTAttributedTextCell.h |
Tasks
Creating Cells
Setting Attributed Content
-
attributedString
property -
textDelegate
property -
– setHTMLString:
-
– setHTMLString:options:
Getting Information
-
– requiredRowHeightInTableView:
-
hasFixedRowHeight
property -
attributedTextContextView
property
Properties
attributedString
The attributed string content of the receiver
@property (nonatomic, strong) NSAttributedString *attributedString
Declared In
DTAttributedTextCell.h
attributedTextContextView
The attributed text content view that the receiver uses to display the attributed text content.
@property (nonatomic, readonly) DTAttributedTextContentView *attributedTextContextView
Declared In
DTAttributedTextCell.h
hasFixedRowHeight
Determines whether the cells built-in contentView is allowed to dictate the size available for text. If active then attributedTextContextView’s height always matches the cell height.
@property (nonatomic, assign) BOOL hasFixedRowHeight
Discussion
Set this to YES
for use in fixed row height table views, leave it NO
for flexible row height table views.
Declared In
DTAttributedTextCell.h
textDelegate
A delegate implementing DTAttributedTextContentViewDelegate to provide custom subviews for images and links.
@property (nonatomic, DT_WEAK_PROPERTY) IBOutlet id<DTAttributedTextContentViewDelegate> textDelegate
Declared In
DTAttributedTextCell.h
Instance Methods
initWithReuseIdentifier:
Creates a tableview cell with a given reuse identifier.
- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier
Parameters
- reuseIdentifier
The reuse identifier to use for the cell
Return Value
A prepared cell
Declared In
DTAttributedTextCell.h
requiredRowHeightInTableView:
Determines the row height that is needed in a specific table view to show the entire text content.
- (CGFloat)requiredRowHeightInTableView:(UITableView *)tableView
Parameters
- tableView
The table view to determine the height for.
Discussion
The table view is necessary because from this the method can know the style. Also the accessory type needs to be set before calling this method because this reduces the available space.
Note: This value is only useful for table views with variable row height.
Declared In
DTAttributedTextCell.h
setHTMLString:
This method allows to set HTML text directly as content of the receiver.
- (void)setHTMLString:(NSString *)html
Parameters
- html
The HTML string to set as the receiver’s text content
Discussion
This will be converted to an attributed string.
Declared In
DTAttributedTextCell.h
setHTMLString:options:
This method allows to set HTML text directly as content of the receiver.
- (void)setHTMLString:(NSString *)html options:(NSDictionary *)options
Parameters
- html
The HTML string to set as the receiver’s text content
- options
The options used for rendering the HTML
Discussion
This will be converted to an attributed string.
Declared In
DTAttributedTextCell.h