Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions TTAlertView/TTAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,14 @@ - (void)setupButtons

self.buttons = [NSMutableArray array];

UIButton *cancelButton = [[UIButton alloc] init];
[cancelButton setBackgroundColor:[UIColor blackColor]];
[cancelButton addTarget:self action:@selector(cancelButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[cancelButton setTitle:self.cancelButtonTitle forState:UIControlStateNormal];
[self.containerView addSubview:cancelButton];
[self.buttons insertObject:cancelButton atIndex:_cancelButtonIndex];
if (self.cancelButtonTitle) {
UIButton *cancelButton = [[UIButton alloc] init];
[cancelButton setBackgroundColor:[UIColor blackColor]];
[cancelButton addTarget:self action:@selector(cancelButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[cancelButton setTitle:self.cancelButtonTitle forState:UIControlStateNormal];
[self.containerView addSubview:cancelButton];
[self.buttons insertObject:cancelButton atIndex:_cancelButtonIndex];
}

[self.otherButtonTitles enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[self addButtonWithTitle:(NSString *)obj];
Expand Down