Skip to content

Commit

Permalink
changes the minimum height to adapt to the image height
Browse files Browse the repository at this point in the history
The minimum height will be the image height
The maximum height will be 180
  • Loading branch information
josecostamartins committed Aug 20, 2018
1 parent efff824 commit 1757e5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion VSAlert/VSAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1757e5f

Please sign in to comment.