Skip to content

Commit 3697bb1

Browse files
committed
Improved vertical position
1 parent 8c1e114 commit 3697bb1

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -778,14 +778,7 @@ - (void)updateViewConstraints {
778778
// because no constraints are added manually in that case
779779
[_passcodeTextField removeConstraints:_passcodeTextField.constraints];
780780
}
781-
782-
// MARK: Please read
783-
// The controller works properly on all devices and orientations, but looks odd on iPhone's landscape.
784-
// Usually, lockscreens on iPhone are kept portrait-only, though. It also doesn't fit inside a modal when landscape.
785-
// That's why only portrait is selected for iPhone's supported orientations.
786-
// Modify this to fit your needs.
787-
788-
CGFloat yOffsetFromCenter = -self.view.frame.size.height * 0.24 + _verticalOffset;
781+
789782
NSLayoutConstraint *enterPasscodeConstraintCenterX =
790783
[NSLayoutConstraint constraintWithItem: _enterPasscodeLabel
791784
attribute: NSLayoutAttributeCenterX
@@ -800,8 +793,8 @@ - (void)updateViewConstraints {
800793
relatedBy: NSLayoutRelationEqual
801794
toItem: _animatingView
802795
attribute: NSLayoutAttributeCenterY
803-
multiplier: 1.0f
804-
constant: yOffsetFromCenter];
796+
multiplier: 0.5f
797+
constant: 0];
805798
[self.view addConstraint: enterPasscodeConstraintCenterX];
806799
[self.view addConstraint: enterPasscodeConstraintCenterY];
807800

0 commit comments

Comments
 (0)