SPComment Class Reference
119 |Inherits from | 126 |NSObject | 127 |
Declared in | 129 |SPComment.h | 130 |
Overview
139 |The SPComment
class provides a programmatic interface for interacting
140 | with Dribbble comments.
The following snippet demonstrates how to retrieve comments for a shot.
143 | 144 |#import <Spectttator/Spectttator.h>
145 |
146 | [SPRequest shotInformationForIdentifier:199295 runOnMainThread:NO withBlock:^(SPShot *shot){
147 | [shot commentsWithPagination:nil runOnMainThread:NO withBlock:^(NSArray *comments, SPPagination *pagination){
148 | NSLog(@"Comments for '%@': %@", shot.title, comments);
149 | }];
150 | }];
151 |
152 |
153 | This is non-blocking, NSLog
will run whenever the comment data has finished loading,
154 | but the block still has access to everything in the scope from where it was defined.
155 | If the block is updating UI elements make sure to set runOnMainThread:YES
, the Dribbble
156 | requests will still be asynchronous but the passed in block will be executed on the main thread.
Tasks
166 | 167 | 168 | 169 |Other Methods
170 | 171 |-
172 |
-
173 |
174 |
identifier
175 |The unique id of the comment.
176 | 177 | property 178 | 179 | -
180 |
181 |
body
182 |The text of the comment.
183 | 184 | property 185 | 186 | -
187 |
188 |
likesCount
189 |The number of players who liked the comment.
190 | 191 | property 192 | 193 | -
194 |
195 |
createdAt
196 |The date the comment was created.
197 | 198 | property 199 | 200 | -
201 |
202 |
player
203 |The player who posted the comment.
204 | 205 | property 206 | 207 |
208 |
Initializing a SPComment Object
213 | 214 |-
215 |
-
216 |
217 |
– initWithDictionary:
218 |Returns a Spectttator comment object initialized with the given comment data.
219 | 220 | 221 | 222 |
223 |
Properties
234 | 235 |body
238 | 239 | 240 | 241 |The text of the comment.
243 |@property (readonly) NSString *body
Declared In
263 |SPComment.h
264 |
createdAt
272 | 273 | 274 | 275 |The date the comment was created.
277 |@property (readonly) NSDate *createdAt
Declared In
297 |SPComment.h
298 |
identifier
306 | 307 | 308 | 309 |The unique id of the comment.
311 |@property (readonly) NSUInteger identifier
Declared In
331 |SPComment.h
332 |
likesCount
340 | 341 | 342 | 343 |The number of players who liked the comment.
345 |@property (readonly) NSUInteger likesCount
Declared In
365 |SPComment.h
366 |
player
374 | 375 | 376 | 377 |The player who posted the comment.
379 |@property (readonly) SPPlayer *player
See Also
397 |-
398 |
399 |
Declared In
408 |SPComment.h
409 |
Instance Methods
423 | 424 |initWithDictionary:
427 | 428 | 429 | 430 |Returns a Spectttator comment object initialized with the given comment data.
432 |- (id)initWithDictionary:(NSDictionary *)dictionary
Parameters
440 | 441 |-
442 |
- dictionary 443 |
A dictionary of comment data.
444 |
Return Value
452 |An initialized SPComment
object.
Discussion
459 | 460 |There is no need to call this method directly, it is used by
461 | higher level methods like [SPShot commentsWithPagination:runOnMainThread:withBlock:]
.
Declared In
472 |SPComment.h
473 |