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 | |
parent | 4161518c33f904d76798c7658afbc6b13750d09f (diff) | |
download | sdl_ios-bugfix/lockscreen_fixes.tar.gz |
Added test view controllersbugfix/lockscreen_fixes
Diffstat (limited to 'Example Apps')
5 files changed, 77 insertions, 8 deletions
diff --git a/Example Apps/Example ObjC/AppDelegate.h b/Example Apps/Example ObjC/AppDelegate.h index b86efb1a6..3f77674a3 100644 --- a/Example Apps/Example ObjC/AppDelegate.h +++ b/Example Apps/Example ObjC/AppDelegate.h @@ -7,6 +7,9 @@ @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; +@property (strong, nonatomic) UIWindow *passwordWindow; +@property (strong, nonatomic) UIWindow *popupWindow; +@property (strong, nonatomic) UIWindow *networkConnectionWindow; @end diff --git a/Example Apps/Example ObjC/AppDelegate.m b/Example Apps/Example ObjC/AppDelegate.m index 1ceb6f765..9e55f5f70 100644 --- a/Example Apps/Example ObjC/AppDelegate.m +++ b/Example Apps/Example ObjC/AppDelegate.m @@ -7,6 +7,9 @@ #import "ProxyManager.h" #import "SDLLogMacros.h" #import "SDLManager.h" +#import "ConnectionIAPTableViewController.h" +#import "PasswordViewController.h" +#import "PopupViewController.h" @interface AppDelegate () @@ -16,9 +19,30 @@ @implementation AppDelegate - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; + // Password window + self.passwordWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; + self.passwordWindow.rootViewController = [PasswordViewController new]; + [self.passwordWindow makeKeyAndVisible]; + + // Popup window + self.popupWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; + self.popupWindow.rootViewController = [PopupViewController new]; + [self.popupWindow makeKeyAndVisible]; + + // Network connection window + UIStoryboard *iapControllerStoryboard = [UIStoryboard storyboardWithName:@"ConnectionIAPTableViewController" bundle:[NSBundle mainBundle]]; + ConnectionIAPTableViewController *iapController = [iapControllerStoryboard instantiateInitialViewController]; + self.networkConnectionWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + self.networkConnectionWindow.backgroundColor = UIColor.greenColor; + self.networkConnectionWindow.rootViewController = iapController; + + self.window = self.networkConnectionWindow; + [self.window makeKeyAndVisible]; + + [ProxyManager.sharedManager startWithProxyTransportType:ProxyTransportTypeIAP]; + + return YES; } - (void)applicationWillResignActive:(UIApplication *)application { diff --git a/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard b/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard index ec5eba61f..deca3f719 100644 --- a/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard +++ b/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="J12-ul-Tx1"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="J12-ul-Tx1"> <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> @@ -44,6 +44,27 @@ </constraints> </tableViewCellContentView> </tableViewCell> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="Mx9-1E-Df2"> + <rect key="frame" x="0.0" y="54" width="375" height="44"/> + <autoresizingMask key="autoresizingMask"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Mx9-1E-Df2" id="aKL-ab-vrF"> + <rect key="frame" x="0.0" y="0.0" width="375" height="44"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dhF-ce-EKB"> + <rect key="frame" x="150" y="7" width="75" height="30"/> + <state key="normal" title="Show Alert"/> + <connections> + <action selector="showAlert:" destination="J12-ul-Tx1" eventType="touchUpInside" id="bN1-Ol-u2i"/> + </connections> + </button> + </subviews> + <constraints> + <constraint firstItem="dhF-ce-EKB" firstAttribute="centerX" secondItem="aKL-ab-vrF" secondAttribute="centerX" id="Jaw-St-ydT"/> + <constraint firstItem="dhF-ce-EKB" firstAttribute="centerY" secondItem="aKL-ab-vrF" secondAttribute="centerY" id="W8z-oz-qLD"/> + </constraints> + </tableViewCellContentView> + </tableViewCell> </cells> </tableViewSection> </sections> 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 diff --git a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist index 8e00f2ea6..1d001773f 100644 --- a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist +++ b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist @@ -47,8 +47,6 @@ <true/> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> - <key>UIMainStoryboardFile</key> - <string>Main</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> |