Skip to content

Commit

Permalink
Add public initializer for SideMenuItemShadow
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Miller committed Feb 8, 2018
1 parent 691f594 commit cbb2db5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions Sources/SideMenuItemShadow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ import Foundation
Defines the parameters for the shadow that is shown under to content controller when the side menu is open.
*/
public struct SideMenuItemShadow {
public var color: UIColor? = UIColor.black
public var opacity: CGFloat = 0.3
public var offset: CGSize = CGSize(width: -5, height: 5)

struct Defaults {
static var defaultColor: UIColor = UIColor.black
static var defaultOpacity: CGFloat = 0.3
static var defaultSize: CGSize = CGSize(width: -5, height: 5)
}

public var color: UIColor? = Defaults.defaultColor
public var opacity: CGFloat = Defaults.defaultOpacity
public var offset: CGSize = Defaults.defaultSize

public init() { }

public init(color: UIColor? = Defaults.defaultColor,
opacity: CGFloat = Defaults.defaultOpacity,
offset: CGSize = Defaults.defaultSize) {
self.color = color
self.opacity = opacity
self.offset = offset
}
}

0 comments on commit cbb2db5

Please sign in to comment.