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 <Foundation/Foundation.h> |
|
19 |
|
|
20 |
/** |
|
21 |
This Model object is a generic type of `Cursor` to represent the range of Tweets |
|
22 |
which have already been loaded from the Twitter API. A dataset that supports |
|
23 |
"cursoring" splits of a set of results (or Tweets in our case) in pages. One |
|
24 |
page is loaded at a time, and the cursor from the previous request is used to |
|
25 |
calculated which set of Tweets should be requested. |
|
26 |
|
|
27 |
|
|
28 |
## Positions |
|
29 |
For User, Search, and List Timelines generally corresponds to a real Tweet ID. |
|
30 |
|
|
31 |
newer Tweets |
|
32 |
(not yet loaded) |
|
33 |
|
|
34 |
-- newest/highest Tweet -- maxPosition |
|
35 |
|
|
36 |
loaded Tweets |
|
37 |
|
|
38 |
-- oldest/lowest Tweet -- minPosition |
|
39 |
minPosition - 1 |
|
40 |
older Tweets |
|
41 |
(not yet loaded) |
|
42 |
|
|
43 |
More: https://dev.twitter.com/overview/api/cursoring |
|
44 |
|
|
45 |
*/ |
|
46 |
@interface TWTRTimelineCursor : NSObject |
|
47 |
|
|
48 |
/** |
|
49 |
* The ID of the Tweet highest up in a batch of Tweets received from a Timeline. |
|
50 |
* Often this corresponds to the newest Tweet in terms of time. |
|
51 |
* |
|
52 |
* For User, Search, and List Timelines this corresponds to a real Tweet ID.. |
|
53 |
*/ |
|
54 |
@property (nonatomic, copy, readonly) NSString *maxPosition; |
|
55 |
|
|
56 |
/** |
|
57 |
* The ID of the Tweet lowest in a batch of Tweets received from a Timeline. This |
|
58 |
* often corresponds to the oldest Tweet in terms of time. |
|
59 |
* |
|
60 |
*/ |
|
61 |
@property (nonatomic, copy, readonly) NSString *minPosition; |
|
62 |
|
655e66
|
63 |
- (instancetype)init NS_UNAVAILABLE; |
a0a843
|
64 |
|
H |
65 |
/** |
|
66 |
* Initialize a new cursor. |
|
67 |
* |
|
68 |
* @param maxPosition The highest (newest) Tweet ID received in this batch of Tweets. |
|
69 |
* @param minPosition The lowest (oldest) Tweet ID received in this batch of Tweets. |
|
70 |
* |
|
71 |
* @return The initialized cursor to be passed back from a request for a Timeline from |
|
72 |
* the Twitter API. |
|
73 |
*/ |
|
74 |
- (instancetype)initWithMaxPosition:(NSString *)maxPosition minPosition:(NSString *)minPosition; |
|
75 |
|
|
76 |
@end |