mvm_core_ui/MVMCoreUI/BaseClasses/View.swift
Pfeil, Scott Robert 7563269680 changes to test
2019-10-23 10:36:32 -04:00

53 lines
1.2 KiB
Swift

//
// View.swift
// MVMCoreUI
//
// Created by Scott Pfeil on 10/23/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import UIKit
public class View: UIView {
var json: [AnyHashable: Any]?
public override init(frame: CGRect) {
super.init(frame: .zero)
setupView()
}
init() {
super.init(frame: .zero)
setupView()
}
public required init?(coder: NSCoder) {
super.init(coder: coder)
setupView()
}
}
extension View: MVMCoreViewProtocol {
public func updateView(_ size: CGFloat) {
}
public func setupView() {
translatesAutoresizingMaskIntoConstraints = false
insetsLayoutMarginsFromSafeArea = false
}
}
extension View: MVMCoreUIMoleculeViewProtocol {
public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
self.json = json
if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) {
backgroundColor = UIColor.mfGet(forHex: backgroundColorString)
}
}
public func reset() {
backgroundColor = .clear
}
}