From 2095fbb13e99ce0879ca1ec30635deebd9e63e86 Mon Sep 17 00:00:00 2001 From: Craig Grummitt Date: Fri, 1 Nov 2019 12:04:39 +0000 Subject: [PATCH] Made button color and shadow color inspectable --- SwiftyButton/PressableButton.swift | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/SwiftyButton/PressableButton.swift b/SwiftyButton/PressableButton.swift index 37c3998..496a75e 100644 --- a/SwiftyButton/PressableButton.swift +++ b/SwiftyButton/PressableButton.swift @@ -26,8 +26,8 @@ open class PressableButton: UIButton { } public struct ColorSet { - let button: UIColor - let shadow: UIColor + var button: UIColor + var shadow: UIColor public init(button: UIColor, shadow: UIColor) { self.button = button @@ -47,6 +47,23 @@ open class PressableButton: UIButton { } } + @IBInspectable + public var buttonColor:UIColor? { + didSet { + if let buttonColor = buttonColor { + colors.button = buttonColor + } + } + } + @IBInspectable + public var shadowColor:UIColor? { + didSet { + if let shadowColor = shadowColor { + colors.shadow = shadowColor + } + } + } + @IBInspectable public var shadowHeight: CGFloat = Defaults.shadowHeight { didSet {