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


@objcMembers open class ThreeLayerFillMiddleTemplate: ThreeLayerTemplate<ThreeLayerFillMiddleTemplateModel> {
    //--------------------------------------------------
    // MARK: - Spacing
    //--------------------------------------------------
    
    open override func spaceBetweenMiddleAndBottom() -> CGFloat? { 0 }
    
    //--------------------------------------------------
    // MARK: - Lifecycle
    //--------------------------------------------------
    
    open override func loadView() {
        super.loadView()
        // The height is used to keep the bottom view at the bottom.
        if let contentView = contentView, let scrollView = scrollView {
            contentView.heightAnchor.constraint(greaterThanOrEqualTo: scrollView.safeAreaLayoutGuide.heightAnchor).isActive = true
        }
    }
    
    open override func handleNewData() {
        super.handleNewData()
        heightConstraint?.isActive = true
    }
}
