Adds back/forward buttons to page menu

This commit is contained in:
James Magahern
2021-02-11 12:26:13 -08:00
parent bd400a006d
commit f32c90f2e3
7 changed files with 127 additions and 12 deletions

View File

@@ -0,0 +1,37 @@
//
// NavigationControlsView.swift
// App
//
// Created by James Magahern on 2/11/21.
//
import UIKit
class NavigationControlsView: DocumentControlView
{
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
}
}