commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
a0a843
|
17 |
|
H |
18 |
#import <UIKit/UIKit.h> |
|
19 |
#import "TWTRTweetView.h" |
|
20 |
|
|
21 |
@class TWTRTweet; |
|
22 |
|
|
23 |
NS_ASSUME_NONNULL_BEGIN |
|
24 |
|
|
25 |
/** |
|
26 |
* A table view cell subclass which displays a Tweet. |
|
27 |
*/ |
|
28 |
@interface TWTRTweetTableViewCell : UITableViewCell |
|
29 |
|
|
30 |
/** |
|
31 |
* The Tweet view inside this cell. Holds all relevant text and images. |
|
32 |
*/ |
|
33 |
@property (nonatomic, readonly) TWTRTweetView *tweetView; |
|
34 |
|
|
35 |
/** |
|
36 |
* Configures the existing Tweet view with a Tweet. Updates labels, images, and thumbnails. |
|
37 |
* |
|
38 |
* @param tweet The `TWTRTweet` model object for the Tweet to display. |
|
39 |
*/ |
|
40 |
- (void)configureWithTweet:(TWTRTweet *)tweet; |
|
41 |
|
|
42 |
/** |
|
43 |
* Returns how tall the Tweet view should be. |
|
44 |
* |
|
45 |
* Uses the system to calculate the Auto Layout height. This is the same as |
|
46 |
* calling sizeThatFits: on a cached TWTRTweetView instance to let the system |
|
47 |
* calculate how tall the resulting view will be including the image, Retweet |
|
48 |
* view, and optional action buttons. |
|
49 |
* |
|
50 |
* Note: The Auto Layout engine will throw an exception if this is called |
|
51 |
* on a background thread. |
|
52 |
* |
|
53 |
* @param tweet the Tweet |
|
54 |
* @param style the style of the Tweet view |
|
55 |
* @param width the width of the Tweet |
|
56 |
* @param showActions whether the Tweet view will be displaying actions |
|
57 |
* |
|
58 |
* @return the calculated height of the Tweet view |
|
59 |
*/ |
|
60 |
+ (CGFloat)heightForTweet:(TWTRTweet *)tweet style:(TWTRTweetViewStyle)style width:(CGFloat)width showingActions:(BOOL)showActions; |
|
61 |
|
|
62 |
@end |
|
63 |
|
|
64 |
NS_ASSUME_NONNULL_END |