diff --git a/CBPinEntryView.podspec b/CBPinEntryView.podspec index 45936d6..223994a 100644 --- a/CBPinEntryView.podspec +++ b/CBPinEntryView.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'CBPinEntryView' - s.version = '1.3.2' + s.version = '1.3.3' s.summary = 'A view for entering arbitrary length numerical pins or codes written in Swift 3.0.' # This description is used to generate tags and improve search results. diff --git a/CBPinEntryView/Classes/CBPinEntryView.swift b/CBPinEntryView/Classes/CBPinEntryView.swift index c39dc6d..6713ff5 100644 --- a/CBPinEntryView/Classes/CBPinEntryView.swift +++ b/CBPinEntryView/Classes/CBPinEntryView.swift @@ -16,15 +16,55 @@ public protocol CBPinEntryViewDelegate { @IBInspectable open var length: Int = CBPinEntryViewDefaults.length - @IBInspectable open var entryCornerRadius: CGFloat = CBPinEntryViewDefaults.entryCornerRadius + @IBInspectable open var entryCornerRadius: CGFloat = CBPinEntryViewDefaults.entryCornerRadius { + didSet { + if oldValue != entryCornerRadius { + updateButtonStyles() + } + } + } + + @IBInspectable open var entryBorderWidth: CGFloat = CBPinEntryViewDefaults.entryBorderWidth { + didSet { + if oldValue != entryBorderWidth { + updateButtonStyles() + } + } + } + + @IBInspectable open var entryDefaultBorderColour: UIColor = CBPinEntryViewDefaults.entryDefaultBorderColour { + didSet { + if oldValue != entryDefaultBorderColour { + updateButtonStyles() + } + } + } + + @IBInspectable open var entryBorderColour: UIColor = CBPinEntryViewDefaults.entryBorderColour { + didSet { + if oldValue != entryBorderColour { + updateButtonStyles() + } + } + } - @IBInspectable open var entryBorderWidth: CGFloat = CBPinEntryViewDefaults.entryBorderWidth - @IBInspectable open var entryDefaultBorderColour: UIColor = CBPinEntryViewDefaults.entryDefaultBorderColour - @IBInspectable open var entryBorderColour: UIColor = CBPinEntryViewDefaults.entryBorderColour @IBInspectable open var entryErrorBorderColour: UIColor = CBPinEntryViewDefaults.entryErrorColour - @IBInspectable open var entryBackgroundColour: UIColor = CBPinEntryViewDefaults.entryBackgroundColour - @IBInspectable open var entryTextColour: UIColor = CBPinEntryViewDefaults.entryTextColour + @IBInspectable open var entryBackgroundColour: UIColor = CBPinEntryViewDefaults.entryBackgroundColour { + didSet { + if oldValue != entryBackgroundColour { + updateButtonStyles() + } + } + } + + @IBInspectable open var entryTextColour: UIColor = CBPinEntryViewDefaults.entryTextColour { + didSet { + if oldValue != entryTextColour { + updateButtonStyles() + } + } + } @IBInspectable open var entryFont: UIFont = CBPinEntryViewDefaults.entryFont @@ -89,9 +129,9 @@ public protocol CBPinEntryViewDelegate { private func createButtons() { for i in 0..