From a705534fce2d5c7403c3683286f0fcd10351ada8 Mon Sep 17 00:00:00 2001 From: Chad Hulbert Date: Wed, 16 Jan 2019 09:46:08 -0500 Subject: [PATCH] Flush/complete pending layout operations before starting a new animation. --- Sources/AloeStackView/AloeStackView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/AloeStackView/AloeStackView.swift b/Sources/AloeStackView/AloeStackView.swift index 3b9fede..5c8625f 100644 --- a/Sources/AloeStackView/AloeStackView.swift +++ b/Sources/AloeStackView/AloeStackView.swift @@ -189,6 +189,7 @@ open class AloeStackView: UIScrollView { guard let cell = row.superview as? StackViewCell, cell.isHidden != isHidden else { return } if animated { + cell.layoutIfNeeded() UIView.animate(withDuration: 0.3) { cell.isHidden = isHidden cell.layoutIfNeeded()