fixing wire ups
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
fba9567de7
commit
974219912b
@ -249,6 +249,7 @@
|
||||
EA3C3BB228996775000CA526 /* MenuViewController.swift */,
|
||||
EAB1D2C828AAAA1D00DAE764 /* ModelScrollViewController.swift */,
|
||||
EA4DB30328DCD25B00103EE3 /* BadgeViewController.swift */,
|
||||
5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */,
|
||||
EA89204D28B67332006B9984 /* CheckBoxGroupViewController.swift */,
|
||||
EAF7F09B2899B92400B287F5 /* CheckboxViewController.swift */,
|
||||
EAB1D2D328AC409F00DAE764 /* LabelViewController.swift */,
|
||||
@ -256,7 +257,6 @@
|
||||
EAF7F11928A14A0E00B287F5 /* RadioButtonViewController.swift */,
|
||||
EA84F76128BE4AE500D67ABC /* RadioSwatchGroupViewController.swift */,
|
||||
EA3C3BB328996775000CA526 /* ToggleViewController.swift */,
|
||||
5FC35BE828D5235A004EBEAC /* ButtonViewController.swift */,
|
||||
);
|
||||
path = ViewControllers;
|
||||
sourceTree = "<group>";
|
||||
|
||||
@ -102,10 +102,4 @@ class UsePicker: PickerBase<Use> {
|
||||
}
|
||||
}
|
||||
|
||||
class ButtonSizePicker: PickerBase<Use.Size> {
|
||||
init(){
|
||||
super.init(items: [.large, .small])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -70,14 +70,14 @@ class ButtonViewController: ModelScrollViewController<DefaultButtonModel> {
|
||||
textField
|
||||
.textPublisher
|
||||
.sink { [weak self] text in
|
||||
self?.button.setTitle(text, for: .normal)
|
||||
self?.button.text = text
|
||||
}.store(in: &subscribers)
|
||||
|
||||
widthTextField
|
||||
.textPublisher
|
||||
.sink { [weak self] text in
|
||||
if let n = NumberFormatter().number(from: text) {
|
||||
self?.button.buttonWidth = CGFloat(truncating: n)
|
||||
self?.button.width = CGFloat(truncating: n)
|
||||
}
|
||||
}.store(in: &subscribers)
|
||||
|
||||
@ -105,8 +105,8 @@ class ButtonViewController: ModelScrollViewController<DefaultButtonModel> {
|
||||
disabledSwitch.isOn = model.disabled
|
||||
textField.text = model.text
|
||||
usePickerSelectorView.text = model.use.rawValue
|
||||
widthTextField.text = "200"
|
||||
buttonSizePickerSelectorView.text = Use.Size.large.rawValue
|
||||
widthTextField.text = ""
|
||||
buttonSizePickerSelectorView.text = ButtonSize.large.rawValue
|
||||
}
|
||||
|
||||
override func updateView(viewModel: DefaultButtonModel) {
|
||||
@ -116,7 +116,7 @@ class ButtonViewController: ModelScrollViewController<DefaultButtonModel> {
|
||||
//Picker
|
||||
var surfacePicker = SurfacePicker()
|
||||
var usePicker = UsePicker()
|
||||
var buttonSizePicker = ButtonSizePicker()
|
||||
var buttonSizePicker = PickerBase<ButtonSize>.init(items: ButtonSize.allCases)
|
||||
|
||||
var pickerType: PickerType = .surface {
|
||||
didSet {
|
||||
@ -153,7 +153,7 @@ class ButtonViewController: ModelScrollViewController<DefaultButtonModel> {
|
||||
}
|
||||
|
||||
buttonSizePicker.onPickerDidSelect = { [weak self] item in
|
||||
self?.button.buttonSize = item
|
||||
self?.button.size = item
|
||||
self?.buttonSizePickerSelectorView.text = item.rawValue
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,15 +20,14 @@ protocol Initable {
|
||||
class MenuViewController: UITableViewController {
|
||||
let items: [MenuComponent] = [
|
||||
MenuComponent(title: "Badge", viewController: BadgeViewController.self),
|
||||
MenuComponent(title: "Button", viewController: ButtonViewController.self),
|
||||
MenuComponent(title: "Checkbox", viewController: CheckboxViewController.self),
|
||||
MenuComponent(title: "CheckboxGroup", viewController: CheckboxGroupViewController.self),
|
||||
MenuComponent(title: "Label", viewController: LabelViewController.self),
|
||||
MenuComponent(title: "RadioButtonGroup", viewController: RadioButtonViewController.self),
|
||||
MenuComponent(title: "RadioBoxGroup", viewController: RadioBoxGroupViewController.self),
|
||||
MenuComponent(title: "RadioSwatchGroup", viewController: RadioSwatchGroupViewController.self),
|
||||
MenuComponent(title: "Toggle", viewController: ToggleViewController.self),
|
||||
MenuComponent(title: "Button", viewController: ButtonViewController.self)
|
||||
|
||||
MenuComponent(title: "Toggle", viewController: ToggleViewController.self)
|
||||
]
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user