Adds back/forward buttons to page menu
This commit is contained in:
37
App/Document Controls UI/NavigationControlsView.swift
Normal file
37
App/Document Controls UI/NavigationControlsView.swift
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user