//
//  BGImageMolecule.swift
//  MVMCoreUI
//
//  Created by Scott Pfeil on 4/28/20.
//  Copyright © 2020 Verizon Wireless. All rights reserved.
//

import Foundation

open class BGImageMolecule: MoleculeContainer {
    
    public let image = LoadImageView(pinnedEdges: .all)
    
    open override func setupView() {
        super.setupView()
        insertSubview(image, at: 0)
        NSLayoutConstraint.constraintPinSubview(toSuperview: image)
    }
    
    open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
        image.setOptional(with: (model as? BGImageMoleculeModel)?.image, delegateObject, additionalData)
        super.set(with: model, delegateObject, additionalData)
    }
}
