From 1757e5f9b4130f08d16867352076dbae16fd2f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Augusto=20C=20Martins=20Jr?= Date: Mon, 20 Aug 2018 19:18:36 -0300 Subject: [PATCH] changes the minimum height to adapt to the image height The minimum height will be the image height The maximum height will be 180 --- VSAlert/VSAlertController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/VSAlert/VSAlertController.m b/VSAlert/VSAlertController.m index 784b158..769f7a5 100755 --- a/VSAlert/VSAlertController.m +++ b/VSAlert/VSAlertController.m @@ -674,7 +674,11 @@ - (void)viewDidLoad { self.alertImage.image = self.image; // Update Constraints - self.headerViewHeightConstraint.constant = (BOOL)self.alertImage.image ? 180.0f : 0.0f; + float height = 0.0f; + if (self.alertImage.image != nil) { + height = self.alertImage.image.size.height >= 180 ? 180.0f : self.alertImage.image.size.height; + } + self.headerViewHeightConstraint.constant = height; // Set Up Background Tap Gesture Recognizer If Needed if (self.dismissOnBackgroundTap) {