diff --git a/VDSSample/ViewControllers/TileContainerViewController.swift b/VDSSample/ViewControllers/TileContainerViewController.swift index d1a571b..7c1bb65 100644 --- a/VDSSample/ViewControllers/TileContainerViewController.swift +++ b/VDSSample/ViewControllers/TileContainerViewController.swift @@ -183,6 +183,9 @@ class TileContainerViewController: BaseViewController { $0.textStyle = .boldBodyLarge $0.text = "This object does NOT reflect normal \"surface\" changes, all properties are maually set" }) + formStackView.addArrangedSubview(Label().with { + $0.text = "For testing max width is limited to 85% of view's width & 65% view's height." + }) addFormRow(label: "Surface", view: surfacePickerSelectorView) addFormRow(label: "Clickable", view: clickableSwitch) addFormRow(label: "Width", view: widthTextField) @@ -242,15 +245,21 @@ class TileContainerViewController: BaseViewController { heightTextField .numberPublisher .sink { [weak self] number in - self?.component.height = number?.cgFloatValue - self?.component.layoutIfNeeded() + guard let self else { return } + if let value = number?.cgFloatValue, value >= 100 && value < self.view.frame.height * 0.65 { + self.component.height = value + self.component.layoutIfNeeded() + } }.store(in: &subscribers) widthTextField .numberPublisher .sink { [weak self] number in - self?.component.width = number?.cgFloatValue - self?.component.layoutIfNeeded() + guard let self else { return } + if let value = number?.cgFloatValue, value >= 100 && value < self.view.frame.width * 0.85 { + self.component.width = value + self.component.layoutIfNeeded() + } }.store(in: &subscribers) }