added back in width
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b17d0b7273
commit
45904c0202
@ -67,8 +67,6 @@ class ButtonGroupViewController: BaseViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
buttonGroup.rowQuantityPhone = 1
|
||||
buttonGroup.rowQuantityTablet = 2
|
||||
buttonGroup.buttons = [
|
||||
makeButton("Button"),
|
||||
makeTextLink("Text Link Button Test Test2"),
|
||||
@ -94,8 +92,7 @@ class ButtonGroupViewController: BaseViewController {
|
||||
addFormRow(label: "Disabled", view: .makeWrapper(for: disabledSwitch))
|
||||
addFormRow(label: "Position", view: buttonPositionSelectorView)
|
||||
addFormRow(label: "Row Quantity", view: rowQuantitySelectorView)
|
||||
|
||||
// addFormRow(label: "Width", view: widthTextField)
|
||||
addFormRow(label: "Width", view: widthTextField)
|
||||
|
||||
|
||||
disabledSwitch
|
||||
@ -104,13 +101,15 @@ class ButtonGroupViewController: BaseViewController {
|
||||
self?.buttonGroup.disabled = sender.isOn
|
||||
}.store(in: &subscribers)
|
||||
|
||||
// widthTextField
|
||||
// .textPublisher
|
||||
// .sink { [weak self] text in
|
||||
// if let n = NumberFormatter().number(from: text) {
|
||||
// self?.buttonGroup.width = CGFloat(truncating: n)
|
||||
// }
|
||||
// }.store(in: &subscribers)
|
||||
widthTextField
|
||||
.textPublisher
|
||||
.sink { [weak self] text in
|
||||
if let n = NumberFormatter().number(from: text) {
|
||||
self?.buttonGroup.buttonWidth = CGFloat(truncating: n)
|
||||
} else {
|
||||
self?.buttonGroup.buttonWidth = 0.0
|
||||
}
|
||||
}.store(in: &subscribers)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user