mvm_core_ui/MVMCoreUI/Molecules/PrimaryButtonViewMoleculeProtocolExtension.swift
Pfeil, Scott Robert 81375ab196 Convert files to swift and simplify
undo top labels bottom buttons view changes
molecule delegates and spacing blocks
Primary Button Molecule
remove module name from swift files.
2019-02-13 23:16:52 -05:00

23 lines
993 B
Swift

//
// 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)
}
}