This repository has been archived by the owner on Oct 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added category to parse fetchUpdate options.
- Loading branch information
1 parent
f43df20
commit 41e08db
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// NSDictionary+HCPFetchUpdateOptions.h | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSDictionary (HCPFetchUpdateOptions) | ||
|
||
- (NSURL *)configURL; | ||
|
||
- (NSDictionary<NSString *, NSString *> *)requestHeaders; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// NSDictionary+HCPFetchUpdateOptions.m | ||
// | ||
|
||
#import "NSDictionary+HCPFetchUpdateOptions.h" | ||
|
||
static NSString *const CONFIG_URL_JSON_KEY = @"config-url"; | ||
static NSString *const REQUEST_HEADERS_JSON_KEY = @"request-headers"; | ||
|
||
@implementation NSDictionary (HCPFetchUpdateOptions) | ||
|
||
- (NSURL *)configURL { | ||
NSString *configPath = self[CONFIG_URL_JSON_KEY]; | ||
|
||
return configPath ? [NSURL URLWithString:configPath] :nil; | ||
} | ||
|
||
- (NSDictionary<NSString *, NSString *> *)requestHeaders { | ||
return self[REQUEST_HEADERS_JSON_KEY]; | ||
} | ||
|
||
|
||
@end |