Skip to content

Commit 8266809

Browse files
author
Joey Lorich
committed
Update header comments on models
1 parent 858c7de commit 8266809

5 files changed

Lines changed: 78 additions & 16 deletions

File tree

EasyReader.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@
578578
9DAC171D170A043200383722 /* Models */ = {
579579
isa = PBXGroup;
580580
children = (
581+
8E7F81EE18D0BF8500BC50C2 /* CSBaseObject.h */,
582+
8E7F81EF18D0BF8500BC50C2 /* CSBaseObject.m */,
581583
0DE51FF618CF919900454E51 /* Feed.h */,
582584
0DE51FF718CF919900454E51 /* Feed.m */,
583585
0DE51FEF18CF911000454E51 /* FeedItem.h */,
584586
0DE51FF018CF911000454E51 /* FeedItem.m */,
585587
0DE51FF118CF911000454E51 /* User.h */,
586588
0DE51FF218CF911000454E51 /* User.m */,
587-
8E7F81EE18D0BF8500BC50C2 /* CSBaseObject.h */,
588-
8E7F81EF18D0BF8500BC50C2 /* CSBaseObject.m */,
589589
);
590590
path = Models;
591591
sourceTree = "<group>";

EasyReader/Application/Models/CSBaseObject.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,23 @@
1111
#import "NSObject+CSNilAdditions.h"
1212
#import "NSString+Inflections.h"
1313

14+
15+
#pragma mark - CSBaseObject -
16+
17+
/**
18+
* A base for NSManagedObjects that represent objects in a remote API object
19+
*/
1420
@interface CSBaseObject : NSManagedObject
21+
22+
23+
#pragma mark - Instance creation from API Data helpers
24+
25+
/*
26+
* Creates or updates an object base on API data
27+
*
28+
* @param remoteObjectData the api data to update/create based on
29+
*/
1530
+ (id)createOrUpdateFirstFromAPIData:(NSDictionary *)remoteObjectData;
1631

32+
1733
@end

EasyReader/Application/Models/Feed.h

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212

1313
@class FeedItem, User;
1414

15+
16+
#pragma mark - Feed -
17+
1518
/**
1619
* An RSS Feed
1720
*/
1821
@interface Feed : CSBaseObject
1922

2023

21-
#pragma mark - Core Data Properties
24+
#pragma mark - Core Data Properties
2225

2326
/// This feed's icon
2427
@property (nonatomic, retain) NSString * icon;
@@ -39,28 +42,48 @@
3942
@property (nonatomic, retain) NSSet *feedItems;
4043

4144

42-
@end
43-
45+
#pragma mark - API Methods
4446

4547
/**
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
4753
*/
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-
5554
+ (void) createFeedWithUrl:(NSString *) url
5655
success:(void(^)(NSDictionary *data))successBlock
5756
failure:(void(^)(NSDictionary *data))failureBlock;
5857

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+
*/
5964
+ (void) requestDefaultFeedsWithSuccess:(void(^)(NSDictionary *data))successBlock
6065
failure:(void(^)(NSDictionary *data))failureBlock;
6166

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+
*/
6273
+ (void) requestFeedsByName:(NSString *) name
6374
success:(void(^)(NSDictionary *data))successBlock
6475
failure:(void(^)(NSDictionary *data))failureBlock;
6576

6677
@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

EasyReader/Application/Models/FeedItem.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
@class Feed;
1414

15+
16+
#pragma mark - FeedItem -
17+
1518
/**
1619
* A single feed item in a feed
1720
*/
@@ -26,7 +29,7 @@
2629
/// The summary for this feed item
2730
@property (nonatomic, retain) NSString * summary;
2831

29-
/// /// The time this feed item was updated
32+
/// The time this feed item was updated
3033
@property (nonatomic, retain) NSDate * updatedAt;
3134

3235
/// The time this feed item's article was published

EasyReader/Application/Models/User.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,38 @@
1212

1313
@class Feed;
1414

15+
#pragma mark - User -
16+
17+
/**
18+
* An EasyReader User generally one per project
19+
*/
1520
@interface User : CSBaseObject
1621

22+
23+
#pragma mark - Core Data Properties
24+
25+
/// The users feeds
1726
@property (nonatomic, retain) NSSet *feeds;
27+
28+
29+
#pragma mark - Methods
30+
31+
/**
32+
* Gets the current user (a singleton shared user)
33+
*/
34+
+ (User *)current;
35+
36+
1837
@end
1938

39+
40+
#pragma mark - Core Data Generated Accessors -
41+
2042
@interface User (CoreDataGeneratedAccessors)
2143

2244
- (void)addFeedsObject:(Feed *)value;
2345
- (void)removeFeedsObject:(Feed *)value;
2446
- (void)addFeeds:(NSSet *)values;
2547
- (void)removeFeeds:(NSSet *)values;
2648

27-
+ (User *)current;
28-
2949
@end

0 commit comments

Comments
 (0)