12345678910111213141516171819202122232425262728293031323334 |
- /*****************************************************************************
- * VLC for iOS
- *****************************************************************************
- * Copyright (c) 2015 VideoLAN. All rights reserved.
- * $Id$
- *
- * Authors: Tobias Conradi <videolan # tobias-conradi.de>
- *
- * Refer to the COPYING file of the official project for license.
- *****************************************************************************/
- #import "UIViewController+VLCAlert.h"
- #import "VLC_iOS-Swift.h"
- @implementation UIViewController (UIViewController_VLCAlert)
- #if TARGET_OS_TV
- - (void)vlc_showAlertWithTitle:(NSString *)title message:(NSString *)message buttonTitle:(NSString *)buttonTitle
- {
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
- [alertController addAction:[UIAlertAction actionWithTitle:buttonTitle style:UIAlertActionStyleDefault handler:nil]];
- [self presentViewController:alertController animated:YES completion:nil];
- }
- #else
- - (void)vlc_showAlertWithTitle:(NSString *)title message:(NSString *)message buttonTitle:(NSString *)buttonTitle
- {
- NSArray<VLCAlertButton *> *buttonsAction = @[[[VLCAlertButton alloc] initWithTitle: buttonTitle
- action: nil]];
- [VLCAlertViewController alertViewManagerWithTitle:title
- errorMessage:message
- viewController:self
- buttonsAction:buttonsAction];
- }
- #endif
- @end
|