//
//  DocumentControlsView.swift
//  App
//
//  Created by James Magahern on 4/28/21.
//

import UIKit

class DocumentControlsView : UIScrollView
{
    public let stackView = StackView<DocumentControlItemView>(dimension: .vertical)
    
    convenience init() {
        self.init(frame: .zero)
        addSubview(stackView)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        let stackViewSize = stackView.sizeThatFits(CGSize(width: bounds.width, height: -1))
        stackView.frame = CGRect(
            origin: .zero, size: stackViewSize
        )
        
        contentSize = stackViewSize
    }
}
