Skip to content

Commit d63a998

Browse files
committed
Made changes proposed
1 parent 44b07f4 commit d63a998

File tree

3 files changed

+8
-54
lines changed

3 files changed

+8
-54
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 3.8.9
2+
* Added support for iOS App Extensions:
3+
* Now, if you add a macro to project settings (LTH_APP_EXTENSIONS), LTHPasscode doesn’t crash. Also, with a new method, you can provide the size of the view in which the LHTPasscode view is going to be presented.
4+
15
# 3.8.8
26
* Fixed translations.
37

LTHPasscodeViewController/LTHPasscodeViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
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)showLockScreenIntoSuperview:(UIView *)superview WithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle;
322+
- (void)showLockScreenIntoSuperview:(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.

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,60 +1010,10 @@ - (void)showLockscreenWithoutAnimation {
10101010
}
10111011

10121012
- (void)showLockScreenWithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle {
1013-
[self _prepareAsLockScreen];
1014-
1015-
// In case the user leaves the app while the lockscreen is already active.
1016-
if (_isCurrentlyOnScreen) { return; }
1017-
_isCurrentlyOnScreen = YES;
1018-
1019-
[LTHMainWindow addSubview: self.view];
1020-
1021-
// All this hassle because a view added to UIWindow does not rotate automatically
1022-
// and if we would have added the view anywhere else, it wouldn't display properly
1023-
// (having a modal on screen when the user leaves the app, for example).
1024-
[self rotateAccordingToStatusBarOrientationAndSupportedOrientations];
1025-
CGPoint newCenter;
1026-
[self statusBarFrameOrOrientationChanged:nil];
1027-
if (LTHiOS8) {
1028-
self.view.center = CGPointMake(self.view.center.x, self.view.center.y * -1.f);
1029-
newCenter = CGPointMake(LTHMainWindow.center.x,
1030-
LTHMainWindow.center.y + self.navigationController.navigationBar.frame.size.height / 2);
1031-
}
1032-
else {
1033-
if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) {
1034-
self.view.center = CGPointMake(self.view.center.x * -1.f, self.view.center.y);
1035-
newCenter = CGPointMake(LTHMainWindow.center.x - self.navigationController.navigationBar.frame.size.height / 2,
1036-
LTHMainWindow.center.y);
1037-
}
1038-
else if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight) {
1039-
self.view.center = CGPointMake(self.view.center.x * 2.f, self.view.center.y);
1040-
newCenter = CGPointMake(LTHMainWindow.center.x + self.navigationController.navigationBar.frame.size.height / 2,
1041-
LTHMainWindow.center.y);
1042-
}
1043-
else if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) {
1044-
self.view.center = CGPointMake(self.view.center.x, self.view.center.y * -1.f);
1045-
newCenter = CGPointMake(LTHMainWindow.center.x,
1046-
LTHMainWindow.center.y - self.navigationController.navigationBar.frame.size.height / 2);
1047-
}
1048-
else {
1049-
self.view.center = CGPointMake(self.view.center.x, self.view.center.y * 2.f);
1050-
newCenter = CGPointMake(LTHMainWindow.center.x,
1051-
LTHMainWindow.center.y + self.navigationController.navigationBar.frame.size.height / 2);
1052-
}
1053-
}
1054-
1055-
[UIView animateWithDuration: animated ? _lockAnimationDuration : 0 animations: ^{
1056-
self.view.center = newCenter;
1057-
}];
1058-
1059-
// Add nav bar & logout button if specified
1060-
if (hasLogout) {
1061-
_isUsingNavBar = hasLogout;
1062-
[self _setupNavBarWithLogoutTitle:logoutTitle];
1063-
}
1013+
[self showLockScreenIntoSuperview:LTHMainWindow withAnimation:animated withLogout:hasLogout andLogoutTitle:logoutTitle];
10641014
}
10651015

1066-
- (void)showLockScreenIntoSuperview:(UIView *)superview WithAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle {
1016+
- (void)showLockScreenIntoSuperview:(UIView *)superview withAnimation:(BOOL)animated withLogout:(BOOL)hasLogout andLogoutTitle:(NSString*)logoutTitle {
10671017
[self _prepareAsLockScreen];
10681018

10691019
// In case the user leaves the app while the lockscreen is already active.
@@ -1076,7 +1026,7 @@ - (void)showLockScreenIntoSuperview:(UIView *)superview WithAnimation:(BOOL)anim
10761026
// and if we would have added the view anywhere else, it wouldn't display properly
10771027
// (having a modal on screen when the user leaves the app, for example).
10781028
[self rotateAccordingToStatusBarOrientationAndSupportedOrientations];
1079-
CGPoint superviewCenter = CGPointMake(superview.frame.size.width/2, superview.frame.size.height/2);
1029+
CGPoint superviewCenter = CGPointMake(superview.center.x, superview.center.y);
10801030
CGPoint newCenter;
10811031
[self statusBarFrameOrOrientationChanged:nil];
10821032
if (LTHiOS8) {

0 commit comments

Comments
 (0)