//
//  NavigationControlsView.swift
//  App
//
//  Created by James Magahern on 2/11/21.
//

import UIKit

class NavigationControlsView: DocumentControlItemView
{
    let backButton = UIButton(frame: .zero)
    let forwardButton = UIButton(frame: .zero)
    
    let stack = StackView(dimension: .horizontal, layoutType: .equalSize)
    
    override init() {
        super.init()
        
        backButton.setImage(UIImage(systemName: "chevron.left"), for: .normal)
        stack.addArrangedSubview(backButton)
        
        forwardButton.setImage(UIImage(systemName: "chevron.right"), for: .normal)
        stack.addArrangedSubview(forwardButton)
        
        addSubview(stack)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        stack.frame = bounds
    }
}
