1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /*****************************************************************************
- * VLCStatusLabel.m
- * VLC for iOS
- *****************************************************************************
- * Copyright (c) 2014 VideoLAN. All rights reserved.
- * $Id$
- *
- * Authors: Carola Nitz <nitz.carola # googlemail.com>
- *
- * Refer to the COPYING file of the official project for license.
- *****************************************************************************/
- #import "VLCAlertView.h"
- @interface VLCAlertView () <UIAlertViewDelegate>
- @end
- // via http://stackoverflow.com/a/10082549/928646
- @implementation VLCAlertView
- - (id)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles {
- self = [self initWithTitle:title message:message delegate:self cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil];
- if (self) {
- for (NSString *buttonTitle in otherButtonTitles) {
- [self addButtonWithTitle:buttonTitle];
- }
- }
- return self;
- }
- - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
- if (self.completion) {
- self.completion(buttonIndex == self.cancelButtonIndex, buttonIndex);
- self.completion = nil;
- }
- }
- @end
|