From be2ac457c1f758059173fe9572aee7332d5a3cbd Mon Sep 17 00:00:00 2001 From: jonkykong Date: Thu, 23 Jul 2020 19:00:12 -0700 Subject: [PATCH] Change default behavior of statusBarEndAlpha as its caused confusion for users who haven't read the documentation. --- Pod/Classes/SideMenuNavigationController.swift | 2 +- Pod/Classes/SideMenuPresentationController.swift | 2 +- README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pod/Classes/SideMenuNavigationController.swift b/Pod/Classes/SideMenuNavigationController.swift index 093d7a29..d88bb8b6 100644 --- a/Pod/Classes/SideMenuNavigationController.swift +++ b/Pod/Classes/SideMenuNavigationController.swift @@ -98,7 +98,7 @@ public struct SideMenuSettings: Model, InitializableStruct { public var presentDuration: Double = 0.35 public var presentationStyle: SideMenuPresentationStyle = .viewSlideOut public var pushStyle: SideMenuPushStyle = .default - public var statusBarEndAlpha: CGFloat = 1 + public var statusBarEndAlpha: CGFloat = 0 public var usingSpringWithDamping: CGFloat = 1 public init() {} diff --git a/Pod/Classes/SideMenuPresentationController.swift b/Pod/Classes/SideMenuPresentationController.swift index a26125da..5fc8a870 100644 --- a/Pod/Classes/SideMenuPresentationController.swift +++ b/Pod/Classes/SideMenuPresentationController.swift @@ -46,7 +46,7 @@ internal final class SideMenuPresentationController { }() private lazy var statusBarView: UIView? = { - guard config.statusBarEndAlpha != 0 else { return nil } + guard config.statusBarEndAlpha > .leastNonzeroMagnitude else { return nil } return UIView { $0.backgroundColor = config.presentationStyle.backgroundColor diff --git a/README.md b/README.md index 77d9a7f6..d0a4332d 100644 --- a/README.md +++ b/README.md @@ -261,8 +261,8 @@ var presentationStyle: SideMenuPresentStyle = .viewSlideOut - subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu. */ var pushStyle: MenuPushStyle = .default -/// Draws `presentationStyle.backgroundColor` behind the status bar. Default is 1. -var statusBarEndAlpha: CGFloat = 1 +/// Draws `presentationStyle.backgroundColor` behind the status bar. Default is 0. +var statusBarEndAlpha: CGFloat = 0 /// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture. var usingSpringWithDamping: CGFloat = 1 /// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller.