summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-05-02 11:36:50 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-05-02 11:36:50 -0400
commit00419ab6f4df546670c4bad3f83caa2b83fda538 (patch)
tree25d5d45827c6a0fe3a6972c6a6f553f4f3ec553b
parent4efa3faf6f098577915bbfb49eb950d85ab06e21 (diff)
downloadsdl_ios-bugfix/issue_1250_lockscreen_rotation.tar.gz
Pod wasn’t working properlybugfix/issue_1250_lockscreen_rotation
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj8
-rwxr-xr-xSmartDeviceLink/SDLScreenshotViewController.m16
-rw-r--r--SmartDeviceLink/UIWindow+SDLExtensions.h19
-rw-r--r--SmartDeviceLink/UIWindow+SDLExtensions.m23
4 files changed, 12 insertions, 54 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index c2a520377..a5579abde 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -481,8 +481,6 @@
5D339CF0207C08BA000CC364 /* SDLVoiceCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D339CEE207C08BA000CC364 /* SDLVoiceCommand.m */; };
5D339CF3207C0ACE000CC364 /* SDLMenuManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D339CF1207C0ACE000CC364 /* SDLMenuManager.h */; };
5D339CF4207C0ACE000CC364 /* SDLMenuManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D339CF2207C0ACE000CC364 /* SDLMenuManager.m */; };
- 5D39BAB7227B3EA8008BCE08 /* UIWindow+SDLExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D39BAB5227B3EA8008BCE08 /* UIWindow+SDLExtensions.h */; };
- 5D39BAB8227B3EA8008BCE08 /* UIWindow+SDLExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D39BAB6227B3EA8008BCE08 /* UIWindow+SDLExtensions.m */; };
5D3E420A20EAAD6500D8C622 /* SDLTPMS.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D3E420820EAAD6500D8C622 /* SDLTPMS.h */; settings = {ATTRIBUTES = (Public, ); }; };
5D3E420B20EAAD6500D8C622 /* SDLTPMS.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D3E420920EAAD6500D8C622 /* SDLTPMS.m */; };
5D3E48751D6F3B330000BFEF /* SDLAsynchronousOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D3E48731D6F3B330000BFEF /* SDLAsynchronousOperation.h */; };
@@ -2095,8 +2093,6 @@
5D339CEE207C08BA000CC364 /* SDLVoiceCommand.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLVoiceCommand.m; sourceTree = "<group>"; };
5D339CF1207C0ACE000CC364 /* SDLMenuManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLMenuManager.h; sourceTree = "<group>"; };
5D339CF2207C0ACE000CC364 /* SDLMenuManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLMenuManager.m; sourceTree = "<group>"; };
- 5D39BAB5227B3EA8008BCE08 /* UIWindow+SDLExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIWindow+SDLExtensions.h"; sourceTree = "<group>"; };
- 5D39BAB6227B3EA8008BCE08 /* UIWindow+SDLExtensions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+SDLExtensions.m"; sourceTree = "<group>"; };
5D3E420820EAAD6500D8C622 /* SDLTPMS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLTPMS.h; sourceTree = "<group>"; };
5D3E420920EAAD6500D8C622 /* SDLTPMS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLTPMS.m; sourceTree = "<group>"; };
5D3E48731D6F3B330000BFEF /* SDLAsynchronousOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLAsynchronousOperation.h; sourceTree = "<group>"; };
@@ -6020,8 +6016,6 @@
E9C32B9B1AB20C5900F283AF /* EAAccessoryManager+SDLProtocols.m */,
DA318C1D1DD0F06C00C035AC /* NSMutableDictionary+Store.h */,
DA318C1E1DD0F06C00C035AC /* NSMutableDictionary+Store.m */,
- 5D39BAB5227B3EA8008BCE08 /* UIWindow+SDLExtensions.h */,
- 5D39BAB6227B3EA8008BCE08 /* UIWindow+SDLExtensions.m */,
);
name = "@categories";
sourceTree = "<group>";
@@ -6133,7 +6127,6 @@
5D8A09811F54B4E5002502A2 /* SDLStreamingMediaManagerDataSource.h in Headers */,
5D61FC9C1A84238C00846EE7 /* SDLEmergencyEventType.h in Headers */,
5D61FD131A84238C00846EE7 /* SDLOnLanguageChange.h in Headers */,
- 5D39BAB7227B3EA8008BCE08 /* UIWindow+SDLExtensions.h in Headers */,
5D61FDE71A84238C00846EE7 /* SDLUnsubscribeButton.h in Headers */,
5DD8406220FCD6C10082CE04 /* SDLElectronicParkBrakeStatus.h in Headers */,
5D61FCAB1A84238C00846EE7 /* SDLFuelCutoffStatus.h in Headers */,
@@ -6950,7 +6943,6 @@
5D61FC681A84238C00846EE7 /* SDLComponentVolumeStatus.m in Sources */,
5D61FDB61A84238C00846EE7 /* SDLSyncMsgVersion.m in Sources */,
5D61FC501A84238C00846EE7 /* SDLBodyInformation.m in Sources */,
- 5D39BAB8227B3EA8008BCE08 /* UIWindow+SDLExtensions.m in Sources */,
88665B6A220B771A00D9DA77 /* SDLPerformAppServiceInteractionResponse.m in Sources */,
5D79A03C1CE36F030035797B /* SDLUploadFileOperation.m in Sources */,
5D61FD901A84238C00846EE7 /* SDLShow.m in Sources */,
diff --git a/SmartDeviceLink/SDLScreenshotViewController.m b/SmartDeviceLink/SDLScreenshotViewController.m
index 33cff0fae..e0e965f7a 100755
--- a/SmartDeviceLink/SDLScreenshotViewController.m
+++ b/SmartDeviceLink/SDLScreenshotViewController.m
@@ -8,8 +8,6 @@
#import "SDLScreenshotViewController.h"
-#import "UIWindow+SDLExtensions.h"
-
@interface SDLScreenshotViewController ()
@property (nonatomic, strong) UIImageView *imageView;
@@ -34,7 +32,7 @@
// HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
- UIViewController *viewController = [UIApplication sharedApplication].windows[0].sdl_topMostController;
+ UIViewController *viewController = [self sdl_topMostControllerForWindow:[UIApplication sharedApplication].windows[0]];
if (viewController != nil) {
return viewController.supportedInterfaceOrientations;
@@ -45,7 +43,7 @@
// HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
- (BOOL)shouldAutorotate {
- UIViewController *viewController = [UIApplication sharedApplication].windows[0].sdl_topMostController;
+ UIViewController *viewController = [self sdl_topMostControllerForWindow:[UIApplication sharedApplication].windows[0]];
if (viewController != nil) {
return viewController.shouldAutorotate;
@@ -54,6 +52,16 @@
return super.shouldAutorotate;
}
+- (UIViewController *)sdl_topMostControllerForWindow:(UIWindow *)window {
+ UIViewController *topController = window.rootViewController;
+
+ while (topController.presentedViewController) {
+ topController = topController.presentedViewController;
+ }
+
+ return topController;
+}
+
- (void)layoutSubviews {
self.imageView.frame = self.view.bounds;
}
diff --git a/SmartDeviceLink/UIWindow+SDLExtensions.h b/SmartDeviceLink/UIWindow+SDLExtensions.h
deleted file mode 100644
index 2c9a259ca..000000000
--- a/SmartDeviceLink/UIWindow+SDLExtensions.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// UIWindow+SDLExtensions.h
-// SmartDeviceLink
-//
-// Created by Joel Fischer on 5/2/19.
-// Copyright © 2019 smartdevicelink. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface UIWindow (SDLExtensions)
-
-@property (strong, nonatomic, readonly) UIViewController *sdl_topMostController;
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/UIWindow+SDLExtensions.m b/SmartDeviceLink/UIWindow+SDLExtensions.m
deleted file mode 100644
index fff4b6b44..000000000
--- a/SmartDeviceLink/UIWindow+SDLExtensions.m
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// UIWindow+SDLExtensions.m
-// SmartDeviceLink
-//
-// Created by Joel Fischer on 5/2/19.
-// Copyright © 2019 smartdevicelink. All rights reserved.
-//
-
-#import "UIWindow+SDLExtensions.h"
-
-@implementation UIWindow (SDLExtensions)
-
-- (UIViewController *)sdl_topMostController {
- UIViewController *topController = self.rootViewController;
-
- while (topController.presentedViewController) {
- topController = topController.presentedViewController;
- }
-
- return topController;
-}
-
-@end