// // PrimaryButtonViewMoleculeProtocolExtension.swift // MVMCoreUI // // Created by Scott Pfeil on 2/12/19. // Copyright © 2019 Verizon Wireless. All rights reserved. // import Foundation extension PrimaryButtonView: MVMCoreUIMoleculeViewProtocol { public func setWithJSON(_ json: [AnyHashable : Any]?, delegate: NSObject?) { let firstButtonMap = json?.optionalDictionaryForKey("FirstButton") let secondButtonMap = json?.optionalDictionaryForKey("SecondButton") if let backgroundColor = json?.optionalStringForKey("backgroundColor") { self.backgroundColor = UIColor.mfGet(forHex: backgroundColor) } let actionDelegate = delegate as? MVMCoreActionDelegateProtocol & NSObjectProtocol let buttonDelegate = delegate as? ButtonDelegateProtocol setup(withPrimaryButtonMap: firstButtonMap, secondaryButtonMap: secondButtonMap, actionDelegate: actionDelegate, additionalData: nil, buttonDelegate: buttonDelegate) } }