forked from dayanch96/YTLite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YTLUserDefaults.m
40 lines (31 loc) · 898 Bytes
/
YTLUserDefaults.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
31
32
33
34
35
36
37
38
39
40
#import "YTLUserDefaults.h"
@implementation YTLUserDefaults
static NSString *const kDefaultsSuiteName = @"com.dvntm.ytlite";
+ (YTLUserDefaults *)standardUserDefaults {
static dispatch_once_t onceToken;
static YTLUserDefaults *defaults = nil;
dispatch_once(&onceToken, ^{
defaults = [[self alloc] initWithSuiteName:kDefaultsSuiteName];
[defaults registerDefaults];
});
return defaults;
}
- (void)reset {
[self removePersistentDomainForName:kDefaultsSuiteName];
}
- (void)registerDefaults {
[self registerDefaults:@{
@"noAds": @YES,
@"backgroundPlayback": @YES,
@"removeUploads": @YES,
@"speedIndex": @1,
@"autoSpeedIndex": @3,
@"wiFiQualityIndex": @0,
@"cellQualityIndex": @0,
@"pivotIndex": @0
}];
}
+ (void)resetUserDefaults {
[[self standardUserDefaults] reset];
}
@end