| 1 | // |
| 2 | // TWTRTweetTableViewCell.h |
| 3 | // |
| 4 | // Copyright (c) 2015 Twitter. All rights reserved. |
| 5 | // |
| 6 | |
| 7 | #import <UIKit/UIKit.h> |
| 8 | #import "TWTRTweetView.h" |
| 9 | |
| 10 | @class TWTRTweet; |
| 11 | |
| 12 | NS_ASSUME_NONNULL_BEGIN |
| 13 | |
| 14 | /** |
| 15 | * A table view cell subclass which displays a Tweet. |
| 16 | */ |
| 17 | @interface TWTRTweetTableViewCell : UITableViewCell |
| 18 | |
| 19 | /** |
| 20 | * The Tweet view inside this cell. Holds all relevant text and images. |
| 21 | */ |
| 22 | @property (nonatomic, readonly) TWTRTweetView *tweetView; |
| 23 | |
| 24 | /** |
| 25 | * Configures the existing Tweet view with a Tweet. Updates labels, images, and thumbnails. |
| 26 | * |
| 27 | * @param tweet The `TWTRTweet` model object for the Tweet to display. |
| 28 | */ |
| 29 | - (void)configureWithTweet:(TWTRTweet *)tweet; |
| 30 | |
| 31 | /** |
| 32 | * Returns how tall the Tweet view should be. |
| 33 | * |
| 34 | * Uses the system to calculate the Auto Layout height. This is the same as |
| 35 | * calling sizeThatFits: on a cached TWTRTweetView instance to let the system |
| 36 | * calculate how tall the resulting view will be including the image, Retweet |
| 37 | * view, and optional action buttons. |
| 38 | * |
| 39 | * Note: The Auto Layout engine will throw an exception if this is called |
| 40 | * on a background thread. |
| 41 | * |
| 42 | * @param tweet the Tweet |
| 43 | * @param style the style of the Tweet view |
| 44 | * @param width the width of the Tweet |
| 45 | * @param showingActions whether the Tweet view will be displaying actions |
| 46 | * |
| 47 | * @return the calculated height of the Tweet view |
| 48 | */ |
| 49 | + (CGFloat)heightForTweet:(TWTRTweet *)tweet style:(TWTRTweetViewStyle)style width:(CGFloat)width showingActions:(BOOL)showActions; |
| 50 | |
| 51 | @end |
| 52 | |
| 53 | NS_ASSUME_NONNULL_END |