Skip to content

Commit

Permalink
Merge pull request #105 from Kurry/feature/add-accessibility-label
Browse files Browse the repository at this point in the history
Set accessibility label on buttons in SDCAlertController
  • Loading branch information
sberrevoets committed Jun 19, 2015
2 parents 4da5ebd + cc27db4 commit 5795146
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SDCAlertView/Source/SDCAlertCollectionViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
if (self) {
_textLabel = [[UILabel alloc] init];
[_textLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
self.isAccessibilityElement = YES;
}

return self;
Expand Down Expand Up @@ -67,8 +68,10 @@ - (void)updateWithAction:(SDCAlertAction *)action visualStyle:(id<SDCAlertContro

if (action.attributedTitle) {
self.textLabel.attributedText = action.attributedTitle;
self.accessibilityLabel = [action.attributedTitle string];
} else {
self.textLabel.text = action.title;
self.accessibilityLabel = action.title;
}

self.enabled = action.isEnabled;
Expand Down

0 comments on commit 5795146

Please sign in to comment.