Skip to content

Commit 858c7de

Browse files
author
Joey Lorich
committed
Fix merge conflicts, update comments
1 parent cb43f47 commit 858c7de

3 files changed

Lines changed: 66 additions & 7 deletions

File tree

EasyReader/Application/Models/Feed.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,39 @@
1212

1313
@class FeedItem, User;
1414

15+
/**
16+
* An RSS Feed
17+
*/
1518
@interface Feed : CSBaseObject
1619

20+
21+
#pragma mark - Core Data Properties
22+
23+
/// This feed's icon
1724
@property (nonatomic, retain) NSString * icon;
25+
26+
/// This feed's name
1827
@property (nonatomic, retain) NSString * name;
28+
29+
/// This feed's RSS url
1930
@property (nonatomic, retain) NSString * url;
31+
32+
/// The remote ID of this feed object on the API
2033
@property (nonatomic, retain) NSNumber * id;
34+
35+
/// The user this feed is associated to
2136
@property (nonatomic, retain) User *user;
37+
38+
/// The items in this feed
2239
@property (nonatomic, retain) NSSet *feedItems;
40+
41+
2342
@end
2443

44+
45+
/**
46+
* Core data generated accessor category
47+
*/
2548
@interface Feed (CoreDataGeneratedAccessors)
2649

2750
- (void)addFeedItemsObject:(FeedItem *)value;

EasyReader/Application/Models/FeedItem.h

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,62 @@
1212

1313
@class Feed;
1414

15+
/**
16+
* A single feed item in a feed
17+
*/
1518
@interface FeedItem : CSBaseObject
1619

20+
21+
#pragma mark - Core Data Properties
22+
23+
/// The article title for this feed item
1724
@property (nonatomic, retain) NSString * title;
25+
26+
/// The summary for this feed item
1827
@property (nonatomic, retain) NSString * summary;
28+
29+
/// /// The time this feed item was updated
1930
@property (nonatomic, retain) NSDate * updatedAt;
31+
32+
/// The time this feed item's article was published
2033
@property (nonatomic, retain) NSDate * publishedAt;
34+
35+
/// The time this feed item was created
2136
@property (nonatomic, retain) NSDate * createdAt;
37+
38+
/// The image for this feed item
2239
@property (nonatomic, retain) NSString * image;
40+
41+
/// The article URL for this feed item
2342
@property (nonatomic, retain) NSString * url;
43+
44+
/// This feed items remote API id
2445
@property (nonatomic, retain) NSNumber * id;
46+
47+
/// The feed this item is in
2548
@property (nonatomic, retain) Feed *feed;
2649

27-
- (NSString *)headline;
2850

51+
#pragma mark - Properties
52+
53+
/// The appropriate headline for this article
54+
@property (readonly) NSString *headline;
55+
56+
57+
#pragma mark - API methods
58+
59+
/**
60+
* Requests new feed items from a group of feeds
61+
*
62+
* @param feeds
63+
* @param startAt
64+
* @param success A block to be run on API call success
65+
* @param failure A block to be run on API call failure
66+
*/
2967
+ (void) requestFeedItemsFromFeeds:(NSSet *)feeds
3068
Since:(NSDate *)startAt
3169
success:(void(^)(NSDictionary *data))successBlock
3270
failure:(void(^)(NSDictionary *data))failureBlock;
3371

72+
3473
@end

EasyReader/Application/Models/FeedItem.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,11 @@ - (NSString *)feedName
3434
return feed.name;
3535
}
3636

37-
- (NSString *)timeAgo
38-
{
39-
return [self.updatedAt timeAgo];
40-
}
41-
4237
- (NSString *)headline
4338
{
44-
return[NSString stringWithFormat:@"%@ \u00b7 %@",[self feedName],[self timeAgo]];
39+
NSString *timeAgo = [self.updatedAt timeAgo];
40+
41+
return[NSString stringWithFormat:@"%@ \u00b7 %@", self.feed.name, timeAgo];
4542
}
4643

4744
+ (void) requestFeedItemsFromFeeds:(NSSet *)feeds

0 commit comments

Comments
 (0)