Skip to content

Commit

Permalink
Merge pull request #46 from josecostamartins/change-minimum-header-he…
Browse files Browse the repository at this point in the history
…ight-constraint

changes the minimum height to adapt to the image height
  • Loading branch information
vsanthanam committed Oct 10, 2018
2 parents 9705c11 + 1757e5f commit 9818cc5
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 9818cc5

Please sign in to comment.