|
12 | 12 |
|
13 | 13 | @class FeedItem, User; |
14 | 14 |
|
| 15 | + |
| 16 | +#pragma mark - Feed - |
| 17 | + |
15 | 18 | /** |
16 | 19 | * An RSS Feed |
17 | 20 | */ |
18 | 21 | @interface Feed : CSBaseObject |
19 | 22 |
|
20 | 23 |
|
21 | | -#pragma mark - Core Data Properties |
| 24 | +#pragma mark - Core Data Properties |
22 | 25 |
|
23 | 26 | /// This feed's icon |
24 | 27 | @property (nonatomic, retain) NSString * icon; |
|
39 | 42 | @property (nonatomic, retain) NSSet *feedItems; |
40 | 43 |
|
41 | 44 |
|
42 | | -@end |
43 | | - |
| 45 | +#pragma mark - API Methods |
44 | 46 |
|
45 | 47 | /** |
46 | | - * Core data generated accessor category |
| 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 |
47 | 53 | */ |
48 | | -@interface Feed (CoreDataGeneratedAccessors) |
49 | | - |
50 | | -- (void)addFeedItemsObject:(FeedItem *)value; |
51 | | -- (void)removeFeedItemsObject:(FeedItem *)value; |
52 | | -- (void)addFeedItems:(NSSet *)values; |
53 | | -- (void)removeFeedItems:(NSSet *)values; |
54 | | - |
55 | 54 | + (void) createFeedWithUrl:(NSString *) url |
56 | 55 | success:(void(^)(NSDictionary *data))successBlock |
57 | 56 | failure:(void(^)(NSDictionary *data))failureBlock; |
58 | 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 | + */ |
59 | 64 | + (void) requestDefaultFeedsWithSuccess:(void(^)(NSDictionary *data))successBlock |
60 | 65 | failure:(void(^)(NSDictionary *data))failureBlock; |
61 | 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 | + */ |
62 | 73 | + (void) requestFeedsByName:(NSString *) name |
63 | 74 | success:(void(^)(NSDictionary *data))successBlock |
64 | 75 | failure:(void(^)(NSDictionary *data))failureBlock; |
65 | 76 |
|
66 | 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