-
Notifications
You must be signed in to change notification settings - Fork 5
/
Config.m
30 lines (24 loc) · 992 Bytes
/
Config.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// Config.m
// RemoteConfig
//
// Created by Kevin Renskers on 23-05-12.
// Copyright (c) 2012 Gangverk. All rights reserved.
//
#import "Config.h"
@implementation Config
+ (Config *)sharedInstance {
static dispatch_once_t pred;
static Config *sharedInstance = nil;
dispatch_once(&pred, ^{ sharedInstance = [[self alloc] init]; });
return sharedInstance;
}
- (NSURL *)remoteFileLocation {
return [NSURL URLWithString:@"https://raw.github.com/gangverk/RemoteConfig/master/Example/example.json"];
}
- (void)setupMapping {
[self mapRemoteKeyPath:@"remote_integer_value" toLocalAttribute:@"exampleIntegerValue" defaultValue:[NSNumber numberWithInteger:1]];
[self mapRemoteKeyPath:@"remote_string_value" toLocalAttribute:@"exampleStringValue" defaultValue:@"Default local value"];
[self mapRemoteKeyPath:@"nonexisting_string_value" toLocalAttribute:@"nonExistingStringValue" defaultValue:@"Default local value for nonexisting value on server"];
}
@end