Put document controls view in a scroll view

This commit is contained in:
James Magahern
2021-04-28 17:03:27 -07:00
parent 69619328dc
commit 557efa40e9
6 changed files with 57 additions and 24 deletions

View File

@@ -0,0 +1,29 @@
//
// 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
}
}