Skip to content

Commit

Permalink
Merge pull request #9 from ClioMobile/master
Browse files Browse the repository at this point in the history
NSArray firstObject is available only since iOS7.
  • Loading branch information
Ryan Maxwell committed Mar 4, 2014
2 parents bd6ded8 + 378f0d3 commit ed78e3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion UIAlertView+Blocks.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ + (instancetype)showWithTitle:(NSString *)title
otherButtonTitles:(NSArray *)otherButtonTitles
tapBlock:(UIAlertViewCompletionBlock)tapBlock {

NSString *firstObject = [otherButtonTitles count] ? [otherButtonTitles objectAtIndex:0] : nil;

UIAlertView *alertView = [[self alloc] initWithTitle:title
message:message
delegate:nil
cancelButtonTitle:cancelButtonTitle
otherButtonTitles:[otherButtonTitles firstObject], nil];
otherButtonTitles:firstObject, nil];

alertView.alertViewStyle = style;

Expand Down

0 comments on commit ed78e3f

Please sign in to comment.