changes made. Reduced access to caret dimensions.

This commit is contained in:
Christiano, Kevin 2019-04-01 16:44:33 -04:00
parent 499f9eb55d
commit dd407f45f9

View File

@ -109,34 +109,24 @@ open class CaretButton: MFCustomButton {
@objc open override func setAsMolecule() {
backgroundColor = .clear
setTitle(actionMap?.optionalStringForKey(KeyTitle), for: .normal)
}
@objc override open func setWithJSON(_ json: [AnyHashable: Any]?, delegate: NSObject?, additionalData: [AnyHashable: Any]?) {
guard let jsonDictionary = json else { return }
setWithActionMap(actionMap, delegate: delegate as? (MVMCoreActionDelegateProtocol & NSObjectProtocol), additionalData: additionalData)
if let backgroundColorHex = jsonDictionary[KeyBackgroundColor] as? String {
guard let dictionary = json else { return }
if let backgroundColorHex = dictionary[KeyBackgroundColor] as? String {
backgroundColor = UIColor.mfGet(forHex: backgroundColorHex)
}
if let enableColorHex = jsonDictionary["enableColor"] as? String {
if let enableColorHex = dictionary["enableColor"] as? String {
enabledColor = UIColor.mfGet(forHex: enableColorHex)
}
if let disabledColorHex = jsonDictionary["disabledColor"] as? String {
if let disabledColorHex = dictionary["disabledColor"] as? String {
disabledColor = UIColor.mfGet(forHex: disabledColorHex)
}
if let caretViewHeight = jsonDictionary["caretViewHeight"] as? NSNumber {
rightViewHeight = caretViewHeight
}
if let caretViewWidth = jsonDictionary["caretViewWidth"] as? NSNumber {
rightViewWidth = caretViewWidth
}
if let buttonText = jsonDictionary["buttonText"] as? String {
setTitle(buttonText, for: .normal)
}
}
}