Merge branch 'feature/buttonGroupUpdate' into 'develop'
added back in width See merge request BPHV_MIPS/vds_ios_sample!12
This commit is contained in:
commit
f35e0de35f
@ -67,17 +67,14 @@ class ButtonGroupViewController: BaseViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
buttonGroup.rowQuantityPhone = 1
|
||||
buttonGroup.rowQuantityTablet = 2
|
||||
buttonGroup.buttons = [
|
||||
makeButton("Button"),
|
||||
makeTextLink("Text Link Button Test Test2"),
|
||||
makeButton("Secondary").with{ $0.use = .secondary },
|
||||
makeButton("Primary"),
|
||||
makeTextLink("Large Text Link"),
|
||||
makeButton("Widge Label Button"),
|
||||
makeButton("Button"),
|
||||
makeTextLinkCaret("Caret Button"),
|
||||
makeButton("Button Test"),
|
||||
makeTextLink("Text Link"),
|
||||
makeTextLinkCaret("Text Caret")
|
||||
makeTextLinkCaret("Text Link Caret"),
|
||||
makeTextLink("Small Text Link").with{ $0.size = .small },
|
||||
makeButton("Small Button").with{$0.size = .small; $0.use = .secondary }
|
||||
]
|
||||
|
||||
addContentTopView(view: buttonGroup)
|
||||
@ -94,8 +91,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 +100,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