diff options
author | NicoleYarroch <nicole@livio.io> | 2019-12-12 10:22:00 -0500 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-12-12 10:22:00 -0500 |
commit | 45a2006cd2a966ee9dcbcc0be48700e93c9cf95e (patch) | |
tree | f152e1ab9213b008fe39408a0ce28e416e43656f /Example Apps/Example ObjC/ConnectionIAPTableViewController.m | |
parent | 4161518c33f904d76798c7658afbc6b13750d09f (diff) | |
download | sdl_ios-bugfix/lockscreen_fixes.tar.gz |
Added test view controllersbugfix/lockscreen_fixes
Diffstat (limited to 'Example Apps/Example ObjC/ConnectionIAPTableViewController.m')
-rw-r--r-- | Example Apps/Example ObjC/ConnectionIAPTableViewController.m | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Example Apps/Example ObjC/ConnectionIAPTableViewController.m b/Example Apps/Example ObjC/ConnectionIAPTableViewController.m index bfb931069..645d38b1d 100644 --- a/Example Apps/Example ObjC/ConnectionIAPTableViewController.m +++ b/Example Apps/Example ObjC/ConnectionIAPTableViewController.m @@ -3,9 +3,8 @@ // SmartDeviceLink-iOS #import "ConnectionIAPTableViewController.h" - #import "ProxyManager.h" - +#import "SmartDeviceLink.h" @interface ConnectionIAPTableViewController () @@ -95,5 +94,29 @@ } } +- (IBAction)showAlert:(id)sender { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"title" message:@"mesaage." preferredStyle:UIAlertControllerStyleActionSheet]; + UIAlertAction *act1 = [UIAlertAction actionWithTitle:@"001" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + + }]; + [alert addAction:act1]; + + int count = 1; + for (UIWindow *window in [UIApplication sharedApplication].windows) { + SDLLogE(@"\n%d:\n\t\trootviewController: %@\n\t\twindow: %@", count, window.rootViewController, window.self); + count += 1; + } + + for (UIWindow *window in [UIApplication sharedApplication].windows) { + if (window.isKeyWindow) { + UIViewController *topViewController = window.rootViewController; + if (topViewController == nil) { + return; + } + [topViewController presentViewController:alert animated:YES completion:nil]; + break; + } + } +} @end |