Skip to content

Commit dddaaf7

Browse files
author
David Jonsén
committed
AutomaticallyAdjustsContentHeight is active by default.
Autolayout bug fix
1 parent 60b9c0c commit dddaaf7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

DJSemiModalViewController/Classes/DJSemiModalViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ open class DJSemiModalViewController: UIViewController {
7777
/**
7878
* Adjust content height automatically
7979
*/
80-
public var automaticallyAdjustsContentHeight: Bool = false
80+
public var automaticallyAdjustsContentHeight: Bool = true
8181

8282
/**
8383
* The title label for the view
@@ -271,6 +271,10 @@ extension DJSemiModalViewController {
271271
scrollViewHeightLayoutConstraint.constant = automaticallyAdjustsContentHeight ? size.height : stackView.frame.height
272272
scrollViewHeightLayoutConstraint.isActive = scrollViewHeightLayoutConstraint.constant > 0.0
273273

274+
275+
contentView.setNeedsUpdateConstraints()
276+
contentView.layoutIfNeeded()
277+
274278
view.setNeedsUpdateConstraints()
275279

276280
UIView.animate(withDuration: 0.25, animations: {

0 commit comments

Comments
 (0)