在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:rolandleth/LTHPasscodeViewController开源软件地址:https://github.com/rolandleth/LTHPasscodeViewController开源编程语言:Objective-C 100.0%开源软件介绍:LTHPasscodeViewControllerSimple to use iOS 7 style Passcode - the one you get in Settings when changing your passcode. How to useDrag the contents of If your app uses extensions,
Example, called in [LTHPasscodeViewController useKeychain:NO];
if ([LTHPasscodeViewController doesPasscodeExist]) {
if ([LTHPasscodeViewController didPasscodeTimerEnd])
[[LTHPasscodeViewController sharedUser] showLockScreenWithAnimation:YES
withLogout:NO
andLogoutTitle:nil];
}
- (void)passcodeViewControllerWillClose;
- (void)maxNumberOfFailedAttemptsReached;
- (void)passcodeWasEnteredSuccessfully;
- (void)logoutButtonWasPressed;
- (NSTimeInterval)timerDuration;
- (void)saveTimerDuration:(NSTimeInterval)duration;
- (NSTimeInterval)timerStartTime;
- (void)saveTimerStartTime;
- (BOOL)didPasscodeTimerEnd;
- (void)deletePasscode;
- (void)savePasscode:(NSString *)passcode;
- (NSString *)passcode;
// All of them fall back on the Keychain if they are not implemented, even if [LTHPasscodeViewController useKeychain:NO] was called, for flexibility over what and where you save.
// Do you only want to save the passcode in a different location and leave everything else in the Keychain? Call [LTHPasscodeViewController useKeychain:NO], but only implement -savePasscode:
/**
@param viewController The view controller where the passcode view controller will be displayed.
@param asModal Set to YES to present as a modal, or to NO to push on the current nav stack.
*/
- (void)showForEnablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
- (void)showForDisablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
- (void)showForChangingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;
// Example:
[[LTHPasscodeViewController sharedUser] showLockscreenWithAnimation:YES withLogout:NO andLogoutTitle:nil];
// Displayed with a slide up animation, which, combined with
// the keyboard sliding down animation, creates an "unlocking" impression.
- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle;
// Example:
[[LTHPasscodeViewController sharedUser] showLockscreenOver:popover withAnimation:YES withLogout:NO andLogoutTitle:nil];
If you're using Storyboards and need to show the lockscreen right at launch, but it's acting weird, you could try and initialise your Storyboard by code, as suggested in this issue by Ben (thank you!). Makes use of SFHFKeyChainUtils to save the passcode in the Keychain. I know he dropped support for it, but I updated it for ARC 2 years ago (with help) and I kept using it since. The 'new' version isn't updated to ARC anyway, so I saw no reason to switch to it, or to any other library. Feel free to contact me, or open an issue if anything is unclear, bugged, or can be improved. Apps using this controlExpenses Planner, DigitalOcean Manager, LovelyHeroku, Flow Web Browser, Balance - Checkbook App, QIF Reader, Zee - Personal Finance, EZDiary, MEGA. If you're using this control, I'd love hearing from you! LicenseLicensed under MIT. If you'd like (or need) a license without attribution, don't hesitate to contact me. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论