Skip to content

Commit 7b84d69

Browse files
committed
Updated README and CHANGELOG
1 parent 8bc0e92 commit 7b84d69

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# 3.8.9
2-
* Added support for iOS App Extensions:
3-
* Now, if you add a macro to project settings (`LTH_APP_EXTENSIONS`), `LTHPasscodeViewController` doesn’t crash under an extension target.
4-
* Also, with a new method, you can provide a view in which the lock is going to be presented and centered in.
2+
* Added support for iOS App Extensions: defining `LTH_IS_APP_EXTENSION` for an extension target will fix `LTHPasscodeViewController` crashing.
3+
* Added new method: `- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle`. Used to provide a view in which the lock is going to be presented, sized to and centered in.
54

65
# 3.8.8
76
* Fixed translations.

LTHPasscodeViewController/LTHPasscodeViewController.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,33 +312,33 @@
312312
@param hasLogout Set to @c YES for a navBar with a Logout button, set to @c NO for no navBar.
313313
@param logoutTitle The title of the Logout button.
314314
*/
315-
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;
315+
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle;
316316
/**
317-
@brief Used for displaying the lock. The passcode view is added directly on the keyWindow.
318-
@param superview The superview where is to be presented, used to measure the center of the view.
317+
@brief Used for displaying the lock over a view; the lock will have the same size and center as the @c superview.
318+
@param superview The @c view where the lock will be added to and presented over.
319319
@param hasLogout Set to @c YES for a navBar with a Logout button, set to @c NO for no navBar.
320320
@param logoutTitle The title of the Logout button.
321321
*/
322-
- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;
322+
- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle;
323323
/**
324324
@brief Used for enabling the passcode.
325325
@details The back bar button is hidden by default. Set @c hidesBackButton to @c NO if you want it to be visible.
326326
@param viewController The view controller where the passcode view controller will be displayed.
327-
@param asModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
327+
@param isModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
328328
*/
329329
- (void)showForEnablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
330330
/**
331331
@brief Used for changing the passcode.
332332
@details The back bar button is hidden by default. Set @c hidesBackButton to @c NO if you want it to be visible.
333333
@param viewController The view controller where the passcode view controller will be displayed.
334-
@param asModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
334+
@param isModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
335335
*/
336336
- (void)showForChangingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
337337
/**
338338
@brief Used for disabling the passcode.
339339
@details The back bar button is hidden by default. Set @c hidesBackButton to @c NO if you want it to be visible.
340340
@param viewController The view controller where the passcode view controller will be displayed.
341-
@param asModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
341+
@param isModal Set to @c YES to present as a modal, or to @c NO to push on the current nav stack.
342342
*/
343343
- (void)showForDisablingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
344344
/**

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
Any help would be greatly appreciated.
5050
*/
5151

52-
#if defined(LTH_APP_EXTENSIONS)
52+
#ifdef LTH_IS_APP_EXTENSION
5353
#define LTHMainWindow [UIApplication sharedApplication].keyWindow
5454
#else
5555
#define LTHMainWindow [UIApplication sharedApplication].windows[0]

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
Simple to use iOS 7 style Passcode - the one you get in Settings when changing your passcode.
33

44
# How to use
5-
Drag the contents of `LTHPasscodeViewController` to your project, or add `pod 'LTHPasscodeViewController'` to your podspec file.
5+
Drag the contents of `LTHPasscodeViewController` to your project, or add `pod 'LTHPasscodeViewController'` to your Podfile (preffered).
6+
7+
If your app uses extensions, `LTH_IS_APP_EXTENSION` needs to be defined:
8+
9+
* either in each target's `Prefix.pch` file, if there is one, via `#define LTH_IS_APP_EXTENSION`
10+
* or in each target's build settings, down to `Preprocessor Macros`, double click each of your schemes, click on the `+` on the popup that appears and add `LTH_IS_APP_EXTENSION`
611

712
Example, called in `application:didFinishLaunchingWithOptions`:
813

@@ -32,7 +37,7 @@ if ([LTHPasscodeViewController doesPasscodeExist]) {
3237
- (void)deletePasscode;
3338
- (void)savePasscode:(NSString *)passcode;
3439
- (NSString *)passcode;
35-
// 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.
40+
// 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.
3641
// 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:
3742
```
3843

@@ -48,30 +53,39 @@ if ([LTHPasscodeViewController doesPasscodeExist]) {
4853
- (void)showForChangingPasscodeInViewController:(UIViewController *)viewController asModal:(BOOL)isModal;
4954
```
5055

51-
* Show the lock screen:
56+
* Show the lock screen over the window:
5257

5358
```objc
5459
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;
5560

5661
// Example:
5762
[[LTHPasscodeViewController sharedUser] showLockscreenWithAnimation:YES withLogout:NO andLogoutTitle:nil];
58-
// Displayed with a slide up animation, which, combined with
63+
// Displayed with a slide up animation, which, combined with
5964
// the keyboard sliding down animation, creates an "unlocking" impression.
6065
```
6166
62-
* entering foreground and resigning is handled from within the class.
67+
* Show the lock screen over a specific view. Works like the above method, but the size and center will be of the passed in view:
68+
69+
```objc
70+
- (void)showLockScreenOver:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString *)logoutTitle;
71+
72+
// Example:
73+
[[LTHPasscodeViewController sharedUser] showLockscreenOver:popover withAnimation:YES withLogout:NO andLogoutTitle:nil];
74+
```
75+
76+
* entering foreground and resigning is handled from within the class.
6377

6478

6579
Makes use of [SFHFKeyChainUtils](https://github.com/ldandersen/scifihifi-iphone) 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](http://stackoverflow.com/questions/7663443/sfhfkeychainutils-ios-keychain-arc-compatible)) 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.
6680

67-
Feel free to [contact me](mailto:[email protected]), or open an issue if anything is unclear, bugged, or can be improved.
81+
Feel free to [contact me](mailto:[email protected]), or open an issue if anything is unclear, bugged, or can be improved.
6882

69-
![Screenshot](http://rolandleth.com/assets/ios7-style-passcode/screenshot.png) ![Screenshot](http://rolandleth.com/assets/ios7-style-passcode/change-passcode-screenshot.png)
83+
![Screenshot](https://rolandleth.com/images/ios7-style-passcode/screenshot.png) ![Screenshot](https://rolandleth.com/images/ios7-style-passcode/change-passcode-screenshot.png)
7084

7185
# Apps using this control
7286
[Expenses Planner](https://itunes.apple.com/us/app/expenses-planner-reminders/id669431471?mt=8), [DigitalOcean Manager](https://itunes.apple.com/us/app/digitalocean-manager/id633128302?mt=8), [LovelyHeroku](https://itunes.apple.com/us/app/lovelyheroku/id706287663?mt=8&uo=4), [Flow Web Browser](https://itunes.apple.com/us/app/flow-web-browser-downloader/id705536564?mt=8), [Balance - Checkbook App](https://itunes.apple.com/US/app/id854362248), [QIF Reader](https://itunes.apple.com/us/app/qif-reader/id374178932?mt=8), [Zee - Personal Finance](https://itunes.apple.com/us/app/zee-personal-finance/id422694086?mt=8), [EZDiary](https://itunes.apple.com/us/app/ezdiary-my-diary/id1128083826?ls=1&mt=8), [MEGA](https://itunes.apple.com/us/app/mega/id706857885?mt=8).
7387

74-
If you're using this control, I'd love hearing from you!
88+
If you're using this control, I'd love hearing from you!
7589

7690
# License
7791
Licensed under MIT. If you'd like (or need) a license without attribution, don't hesitate to [contact me](mailto:[email protected]).

0 commit comments

Comments
 (0)