Skip to content

Commit 2c6a305

Browse files
committed
enable update title and message after presenting
1 parent 2b3b3c2 commit 2c6a305

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

SIAlertView/SIAlertView.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ - (void)validateLayout
382382

383383
CGFloat y = CONTENT_PADDING_TOP;
384384
if (self.titleLabel) {
385+
self.titleLabel.text = self.alertView.title;
385386
CGFloat height = [self heightForTitleLabel];
386387
self.titleLabel.frame = CGRectMake(CONTENT_PADDING_LEFT, y, self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2, height);
387388
y += height;
@@ -390,6 +391,7 @@ - (void)validateLayout
390391
if (y > CONTENT_PADDING_TOP) {
391392
y += GAP;
392393
}
394+
self.messageLabel.text = self.alertView.message;
393395
CGFloat height = [self heightForMessageLabel];
394396
self.messageLabel.frame = CGRectMake(CONTENT_PADDING_LEFT, y, self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2, height);
395397
y += height;

SIAlertViewExample/SIAlertViewExample/ViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ - (IBAction)alert1:(id)sender
5757
};
5858

5959
[alertView show];
60+
61+
alertView.title = @"New Title";
6062
}
6163

6264
- (IBAction)alert2:(id)sender

0 commit comments

Comments
 (0)