Skip to content

Commit 17e4908

Browse files
author
Stephanie Sharp
committed
Fix crashes caused by calls to layoutIfNeeded (replace with setNeedsLayout)
1 parent 1bc438b commit 17e4908

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

MaterialTextField/MFTextField.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ - (void)showPlaceholderLabelAnimated:(BOOL)animated
418418
}
419419

420420
if (animated && !self.placeholderIsAnimating) {
421-
[self layoutIfNeeded];
421+
[self setNeedsLayout];
422422
self.placeholderIsAnimating = YES;
423423
self.placeholderLabelTopConstraint.constant = 0;
424424

@@ -451,7 +451,7 @@ - (void)hidePlaceholderLabelAnimated:(BOOL)animated
451451
}
452452

453453
if (animated && !self.placeholderIsAnimating) {
454-
[self layoutIfNeeded];
454+
[self setNeedsLayout];
455455
self.placeholderIsAnimating = YES;
456456
self.placeholderLabelTopConstraint.constant = finalDistanceFromTop;
457457

@@ -553,7 +553,7 @@ - (void)showErrorLabelAnimated:(BOOL)animated
553553
- (void)hideErrorLabelAnimated:(BOOL)animated
554554
{
555555
if (animated && !self.errorIsAnimating) {
556-
[self layoutIfNeeded];
556+
[self setNeedsLayout];
557557
self.errorIsAnimating = YES;
558558
[UIView animateWithDuration:MFDefaultAnimationDuration * 0.5
559559
delay:0.0

0 commit comments

Comments
 (0)