Merge branch 'bugfix/widthHeightLimitations' into 'develop'
Added minor fix for max width & height See merge request BPHV_MIPS/vds_ios_sample!54
This commit is contained in:
commit
09f4fa7545
@ -183,6 +183,9 @@ class TileContainerViewController: BaseViewController<TileContainer> {
|
|||||||
$0.textStyle = .boldBodyLarge
|
$0.textStyle = .boldBodyLarge
|
||||||
$0.text = "This object does NOT reflect normal \"surface\" changes, all properties are maually set"
|
$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: "Surface", view: surfacePickerSelectorView)
|
||||||
addFormRow(label: "Clickable", view: clickableSwitch)
|
addFormRow(label: "Clickable", view: clickableSwitch)
|
||||||
addFormRow(label: "Width", view: widthTextField)
|
addFormRow(label: "Width", view: widthTextField)
|
||||||
@ -242,15 +245,21 @@ class TileContainerViewController: BaseViewController<TileContainer> {
|
|||||||
heightTextField
|
heightTextField
|
||||||
.numberPublisher
|
.numberPublisher
|
||||||
.sink { [weak self] number in
|
.sink { [weak self] number in
|
||||||
self?.component.height = number?.cgFloatValue
|
guard let self else { return }
|
||||||
self?.component.layoutIfNeeded()
|
if let value = number?.cgFloatValue, value >= 100 && value < self.view.frame.height * 0.65 {
|
||||||
|
self.component.height = value
|
||||||
|
self.component.layoutIfNeeded()
|
||||||
|
}
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
widthTextField
|
widthTextField
|
||||||
.numberPublisher
|
.numberPublisher
|
||||||
.sink { [weak self] number in
|
.sink { [weak self] number in
|
||||||
self?.component.width = number?.cgFloatValue
|
guard let self else { return }
|
||||||
self?.component.layoutIfNeeded()
|
if let value = number?.cgFloatValue, value >= 100 && value < self.view.frame.width * 0.85 {
|
||||||
|
self.component.width = value
|
||||||
|
self.component.layoutIfNeeded()
|
||||||
|
}
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user