|
12 | 12 |
|
13 | 13 | @class FeedItem, User; |
14 | 14 |
|
| 15 | + |
| 16 | +#pragma mark - Feed - |
| 17 | + |
| 18 | +/** |
| 19 | + * An RSS Feed |
| 20 | + */ |
15 | 21 | @interface Feed : CSBaseObject |
16 | 22 |
|
| 23 | + |
| 24 | +#pragma mark - Core Data Properties |
| 25 | + |
| 26 | +/// This feed's icon |
17 | 27 | @property (nonatomic, retain) NSString * icon; |
| 28 | + |
| 29 | +/// This feed's name |
18 | 30 | @property (nonatomic, retain) NSString * name; |
| 31 | + |
| 32 | +/// This feed's RSS url |
19 | 33 | @property (nonatomic, retain) NSString * url; |
| 34 | + |
| 35 | +/// The remote ID of this feed object on the API |
20 | 36 | @property (nonatomic, retain) NSNumber * id; |
| 37 | + |
| 38 | +/// The user this feed is associated to |
21 | 39 | @property (nonatomic, retain) User *user; |
| 40 | + |
| 41 | +/// The items in this feed |
22 | 42 | @property (nonatomic, retain) NSSet *feedItems; |
23 | | -@end |
24 | 43 |
|
25 | | -@interface Feed (CoreDataGeneratedAccessors) |
26 | 44 |
|
27 | | -- (void)addFeedItemsObject:(FeedItem *)value; |
28 | | -- (void)removeFeedItemsObject:(FeedItem *)value; |
29 | | -- (void)addFeedItems:(NSSet *)values; |
30 | | -- (void)removeFeedItems:(NSSet *)values; |
| 45 | +#pragma mark - API Methods |
31 | 46 |
|
| 47 | +/** |
| 48 | + * Creates a new feed based on a given url |
| 49 | + * |
| 50 | + * @param url |
| 51 | + * @param successBlock A block to be run on API call success |
| 52 | + * @param failureBlock A block to be run on API call failure |
| 53 | + */ |
32 | 54 | + (void) createFeedWithUrl:(NSString *) url |
33 | 55 | success:(void(^)(NSDictionary *data))successBlock |
34 | 56 | failure:(void(^)(NSDictionary *data))failureBlock; |
35 | 57 |
|
| 58 | +/** |
| 59 | + * Requests the default feeds list (called once on the first app run) |
| 60 | + * |
| 61 | + * @param successBlock A block to be run on API call success |
| 62 | + * @param failureBlock A block to be run on API call failure |
| 63 | + */ |
36 | 64 | + (void) requestDefaultFeedsWithSuccess:(void(^)(NSDictionary *data))successBlock |
37 | 65 | failure:(void(^)(NSDictionary *data))failureBlock; |
38 | 66 |
|
| 67 | +/** |
| 68 | + * Requests a list of feeds by name (search) |
| 69 | + * |
| 70 | + * @param successBlock A block to be run on API call success |
| 71 | + * @param failureBlock A block to be run on API call failure |
| 72 | + */ |
39 | 73 | + (void) requestFeedsByName:(NSString *) name |
40 | 74 | success:(void(^)(NSDictionary *data))successBlock |
41 | 75 | failure:(void(^)(NSDictionary *data))failureBlock; |
42 | 76 |
|
43 | 77 | @end |
| 78 | + |
| 79 | + |
| 80 | +#pragma mark - Core Data Generated Accessors - |
| 81 | + |
| 82 | +@interface Feed (CoreDataGeneratedAccessors) |
| 83 | + |
| 84 | +- (void)addFeedItemsObject:(FeedItem *)value; |
| 85 | +- (void)removeFeedItemsObject:(FeedItem *)value; |
| 86 | +- (void)addFeedItems:(NSSet *)values; |
| 87 | +- (void)removeFeedItems:(NSSet *)values; |
| 88 | + |
| 89 | +@end |
0 commit comments