Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to use subclassed shared instance #95

Merged
merged 2 commits into from
Nov 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions LTHPasscodeViewController/LTHPasscodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,58 +74,58 @@ @implementation LTHPasscodeViewController

#pragma mark - Public, class methods
+ (BOOL)doesPasscodeExist {
return [[LTHPasscodeViewController sharedUser] _doesPasscodeExist];
return [[self sharedUser] _doesPasscodeExist];
}


+ (NSString *)passcode {
return [[LTHPasscodeViewController sharedUser] _passcode];
return [[self sharedUser] _passcode];
}


+ (NSTimeInterval)timerDuration {
return [[LTHPasscodeViewController sharedUser] _timerDuration];
return [[self sharedUser] _timerDuration];
}


+ (void)saveTimerDuration:(NSTimeInterval)duration {
[[LTHPasscodeViewController sharedUser] _saveTimerDuration:duration];
[[self sharedUser] _saveTimerDuration:duration];
}


+ (NSTimeInterval)timerStartTime {
return [[LTHPasscodeViewController sharedUser] _timerStartTime];
return [[self sharedUser] _timerStartTime];
}


+ (void)saveTimerStartTime {
[[LTHPasscodeViewController sharedUser] _saveTimerStartTime];
[[self sharedUser] _saveTimerStartTime];
}


+ (BOOL)didPasscodeTimerEnd {
return [[LTHPasscodeViewController sharedUser] _didPasscodeTimerEnd];
return [[self sharedUser] _didPasscodeTimerEnd];
}


+ (void)deletePasscodeAndClose {
[LTHPasscodeViewController deletePasscode];
[LTHPasscodeViewController close];
[self deletePasscode];
[self close];
}


+ (void)close {
[[LTHPasscodeViewController sharedUser] _close];
[[self sharedUser] _close];
}


+ (void)deletePasscode {
[[LTHPasscodeViewController sharedUser] _deletePasscode];
[[self sharedUser] _deletePasscode];
}


+ (void)useKeychain:(BOOL)useKeychain {
[[LTHPasscodeViewController sharedUser] _useKeychain:useKeychain];
[[self sharedUser] _useKeychain:useKeychain];
}


Expand Down Expand Up @@ -1390,7 +1390,7 @@ + (instancetype)sharedUser {

static dispatch_once_t pred;
dispatch_once(&pred, ^{
sharedObject = [[LTHPasscodeViewController alloc] init];
sharedObject = [[self alloc] init];
});

return sharedObject;
Expand Down