Skip to content

Commit

Permalink
Change default behavior of statusBarEndAlpha as its caused confusion …
Browse files Browse the repository at this point in the history
…for users who haven't read the documentation.
  • Loading branch information
jonkykong committed Jul 24, 2020
1 parent c451180 commit be2ac45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Pod/Classes/SideMenuNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/SideMenuPresentationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit be2ac45

Please sign in to comment.