summaryrefslogtreecommitdiff
path: root/Example Apps/Example ObjC/ConnectionIAPTableViewController.m
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-12-12 10:22:00 -0500
committerNicoleYarroch <nicole@livio.io>2019-12-12 10:22:00 -0500
commit45a2006cd2a966ee9dcbcc0be48700e93c9cf95e (patch)
treef152e1ab9213b008fe39408a0ce28e416e43656f /Example Apps/Example ObjC/ConnectionIAPTableViewController.m
parent4161518c33f904d76798c7658afbc6b13750d09f (diff)
downloadsdl_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.m27
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