|
1
|
// |
|
2
|
// TWTRTweetDetailViewController.h |
|
3
|
// TwitterKit |
|
4
|
// |
|
5
|
// Copyright © 2016 Twitter. All rights reserved. |
|
6
|
// |
|
7
|
|
|
8
|
#import <UIKit/UIKit.h> |
|
9
|
@class TWTRTweet; |
|
10
|
@class TWTRUser; |
|
11
|
@class TWTRTweetCashtagEntity; |
|
12
|
@class TWTRTweetHashtagEntity; |
|
13
|
@class TWTRTweetUserMentionEntity; |
|
14
|
@protocol TWTRTweetDetailViewControllerDelegate; |
|
15
|
|
|
16
|
NS_ASSUME_NONNULL_BEGIN |
|
17
|
|
|
18
|
/** |
|
19
|
* A view controller which shows the detailed Tweet content. |
|
20
|
*/ |
|
21
|
@interface TWTRTweetDetailViewController : UIViewController |
|
22
|
|
|
23
|
/** |
|
24
|
* The Tweet being displayed. |
|
25
|
*/ |
|
26
|
@property (nonatomic, readonly) TWTRTweet *tweet; |
|
27
|
|
|
28
|
/** |
|
29
|
* The delegate for this view controller. |
|
30
|
*/ |
|
31
|
@property (nonatomic, weak) id<TWTRTweetDetailViewControllerDelegate> delegate; |
|
32
|
|
|
33
|
/** |
|
34
|
* The scroll view which is the root view of the view controller. |
|
35
|
* This view is exposed to allow for the adjustment of the scroll view's |
|
36
|
* contentInset or to interact with the scroll view's gesture recognizers. |
|
37
|
*/ |
|
38
|
@property (nonatomic, readonly) UIScrollView *scrollView; |
|
39
|
|
|
40
|
/** |
|
41
|
* The background color of the view. |
|
42
|
*/ |
|
43
|
@property (nonatomic, null_resettable) UIColor *backgroundColor; |
|
44
|
|
|
45
|
/** |
|
46
|
* The primary text color. This value will be applied to the |
|
47
|
* username and tweet text. |
|
48
|
*/ |
|
49
|
@property (nonatomic, null_resettable) UIColor *primaryTextColor; |
|
50
|
|
|
51
|
/** |
|
52
|
* The secondary text color. |
|
53
|
*/ |
|
54
|
@property (nonatomic, null_resettable) UIColor *secondaryTextColor; |
|
55
|
|
|
56
|
/** |
|
57
|
* A color to apply to links. |
|
58
|
*/ |
|
59
|
@property (nonatomic, null_resettable) UIColor *linkTextColor; |
|
60
|
|
|
61
|
/** |
|
62
|
* A value indicating the amount that the action bar should be offset |
|
63
|
* from the bottom of the bar. A positive amount will move the view up |
|
64
|
* while a negative amount will move it down. |
|
65
|
*/ |
|
66
|
@property (nonatomic) CGFloat actionBarInset; |
|
67
|
|
|
68
|
/** |
|
69
|
* Initializes the receiver with the given tweet. |
|
70
|
*/ |
|
71
|
- (instancetype)initWithTweet:(TWTRTweet *)tweet; |
|
72
|
|
|
73
|
@end |
|
74
|
|
|
75
|
@protocol TWTRTweetDetailViewControllerDelegate <NSObject> |
|
76
|
|
|
77
|
@optional |
|
78
|
|
|
79
|
/** |
|
80
|
* called when a URL in the text of a tweet was tapped. Implement to show your own webview rather than opening Safari. |
|
81
|
* |
|
82
|
* @param controller The TWTRTweetDetailViewController. |
|
83
|
* @param url The URL that was tapped. |
|
84
|
*/ |
|
85
|
- (void)tweetDetailViewController:(TWTRTweetDetailViewController *)controller didTapURL:(NSURL *)URL; |
|
86
|
|
|
87
|
/** |
|
88
|
* Called when the user's profile image is tapped. |
|
89
|
* If this method is not implemented and the device is running on iOS 9+ we will deep link into the Twitter application. |
|
90
|
* |
|
91
|
* @param controller The TWTRTweetDetailViewController. |
|
92
|
* @param user The Twitter user. |
|
93
|
*/ |
|
94
|
- (void)tweetDetailViewController:(TWTRTweetDetailViewController *)controller didTapProfileImageForUser:(TWTRUser *)user; |
|
95
|
|
|
96
|
/** |
|
97
|
* Called when a hashtag in the text of a tweet was tapped. |
|
98
|
* |
|
99
|
* @param controller The TWTRTweetDetailViewController. |
|
100
|
* @param hashtag The hashtag that was tapped. |
|
101
|
*/ |
|
102
|
- (void)tweetDetailViewController:(TWTRTweetDetailViewController *)controller didTapHashtag:(TWTRTweetHashtagEntity *)hashtag; |
|
103
|
|
|
104
|
/** |
|
105
|
* Called when a cashtag in the text of a tweet was tapped. |
|
106
|
* |
|
107
|
* @param controller The TWTRTweetDetailViewController. |
|
108
|
* @param cashtag The cashtag that was tapped. |
|
109
|
*/ |
|
110
|
- (void)tweetDetailViewController:(TWTRTweetDetailViewController *)controller didTapCashtag:(TWTRTweetCashtagEntity *)cashtag; |
|
111
|
|
|
112
|
/** |
|
113
|
* Called when a user mention in the text of a tweet was tapped. |
|
114
|
* |
|
115
|
* @param controller The TWTRTweetDetailViewController. |
|
116
|
* @param userMention The user mention that was tapped. |
|
117
|
*/ |
|
118
|
- (void)tweetDetailViewController:(TWTRTweetDetailViewController *)controller didTapUserMention:(TWTRTweetUserMentionEntity *)userMention; |
|
119
|
|
|
120
|
@end |
|
121
|
|
|
122
|
NS_ASSUME_NONNULL_END |