diff options
author | Frank Elias <francois.elias@livio.io> | 2020-10-16 13:57:09 -0400 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2020-10-16 13:57:09 -0400 |
commit | e1a741b671a9ae40ba32d70ada33cf900c87712f (patch) | |
tree | 3d3e534f9871df0c052b8b1d1888bc0639eab615 | |
parent | 5341122ed61efbbf71c6fc60bacd3e8638066a18 (diff) | |
download | sdl_ios-bugfix/issue-1794-set-SDLLockScreenViewController-to-be-presented-fullScreen-by-default.tar.gz |
Set a default value for screen presentation stylebugfix/issue-1794-set-SDLLockScreenViewController-to-be-presented-fullScreen-by-default
Set a default value for screen presentation style
-rw-r--r-- | SmartDeviceLink/public/SDLLockScreenViewController.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/public/SDLLockScreenViewController.m | 22 |
2 files changed, 22 insertions, 5 deletions
diff --git a/SmartDeviceLink/public/SDLLockScreenViewController.h b/SmartDeviceLink/public/SDLLockScreenViewController.h index acce47b1f..fb3d38710 100644 --- a/SmartDeviceLink/public/SDLLockScreenViewController.h +++ b/SmartDeviceLink/public/SDLLockScreenViewController.h @@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN typedef void (^SwipeGestureCallbackBlock)(void); /** + * The SDL Lock Screen's presentation style. + */ +@property(nonatomic, assign) UIModalPresentationStyle modalPresentationStyle; + +/** * The app's icon. This will be set by the lock screen configuration. */ @property (copy, nonatomic, nullable) UIImage *appIcon; diff --git a/SmartDeviceLink/public/SDLLockScreenViewController.m b/SmartDeviceLink/public/SDLLockScreenViewController.m index 18b0a8480..047385337 100644 --- a/SmartDeviceLink/public/SDLLockScreenViewController.m +++ b/SmartDeviceLink/public/SDLLockScreenViewController.m @@ -32,11 +32,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLLockScreenViewController - -- (void)awakeFromNib { - [super awakeFromNib]; - self.modalPresentationStyle = UIModalPresentationFullScreen; -} +@synthesize modalPresentationStyle = _modalPresentationStyle; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -66,6 +62,10 @@ NS_ASSUME_NONNULL_BEGIN return useWhiteIcon ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; } +- (UIModalPresentationStyle)modalPresentationStyle { + return _modalPresentationStyle; +} + #pragma mark - Setters - (void)setAppIcon:(UIImage *_Nullable)appIcon { @@ -92,6 +92,18 @@ NS_ASSUME_NONNULL_BEGIN [self sdl_layoutViews]; } +- (void)setModalPresentationStyle:(UIModalPresentationStyle)modalPresentationStyle { + if (@available(iOS 13.0, *)) { + if (modalPresentationStyle == UIModalPresentationAutomatic) { + _modalPresentationStyle = UIModalPresentationFullScreen; + } else { + _modalPresentationStyle = modalPresentationStyle; + } + } else { + _modalPresentationStyle = modalPresentationStyle; + } +} + #pragma mark - Swipe Gesture - (void)addDismissGestureWithCallback:(SwipeGestureCallbackBlock)swipeGestureCallback { |