removed radio swatch
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
4820dc66cd
commit
9605be6796
@ -56,7 +56,6 @@
|
||||
EA5E305C295111050082B959 /* TileletViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5E305B295111050082B959 /* TileletViewController.swift */; };
|
||||
EA5F86CE2A1E863F00BC83E4 /* TabsContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5F86CD2A1E863F00BC83E4 /* TabsContainerViewController.swift */; };
|
||||
EA81410E2A0ED8DC004F60D2 /* ButtonIconViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA81410D2A0ED8DC004F60D2 /* ButtonIconViewController.swift */; };
|
||||
EA84F76228BE4AE500D67ABC /* RadioSwatchGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA84F76128BE4AE500D67ABC /* RadioSwatchGroupViewController.swift */; };
|
||||
EA89201928B56DF5006B9984 /* RadioBoxGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89201828B56DF5006B9984 /* RadioBoxGroupViewController.swift */; };
|
||||
EA89204628B66CE2006B9984 /* ScrollViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89203F28B66CE2006B9984 /* ScrollViewController.swift */; };
|
||||
EA89204728B66CE2006B9984 /* KeyboardFrameChangeListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA89204028B66CE2006B9984 /* KeyboardFrameChangeListener.swift */; };
|
||||
@ -153,7 +152,6 @@
|
||||
EA5E305B295111050082B959 /* TileletViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TileletViewController.swift; sourceTree = "<group>"; };
|
||||
EA5F86CD2A1E863F00BC83E4 /* TabsContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsContainerViewController.swift; sourceTree = "<group>"; };
|
||||
EA81410D2A0ED8DC004F60D2 /* ButtonIconViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonIconViewController.swift; sourceTree = "<group>"; };
|
||||
EA84F76128BE4AE500D67ABC /* RadioSwatchGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatchGroupViewController.swift; sourceTree = "<group>"; };
|
||||
EA89201828B56DF5006B9984 /* RadioBoxGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioBoxGroupViewController.swift; sourceTree = "<group>"; };
|
||||
EA89203F28B66CE2006B9984 /* ScrollViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScrollViewController.swift; sourceTree = "<group>"; };
|
||||
EA89204028B66CE2006B9984 /* KeyboardFrameChangeListener.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyboardFrameChangeListener.swift; sourceTree = "<group>"; };
|
||||
@ -329,7 +327,6 @@
|
||||
EA0D1C302A673F3500E5C127 /* RadioButtonViewController.swift */,
|
||||
EA0D1C322A673FD400E5C127 /* RadioButtonItemViewController.swift */,
|
||||
EAF7F11928A14A0E00B287F5 /* RadioButtonGroupViewController.swift */,
|
||||
EA84F76128BE4AE500D67ABC /* RadioSwatchGroupViewController.swift */,
|
||||
EA5F86CD2A1E863F00BC83E4 /* TabsContainerViewController.swift */,
|
||||
EA596AB92A16B2ED00300C4B /* TabsViewController.swift */,
|
||||
EA0FC2C02912DC5500DF80B4 /* TextLinkCaretViewController.swift */,
|
||||
@ -535,7 +532,6 @@
|
||||
EAD062A52A3B5CDF0015965D /* Slider.swift in Sources */,
|
||||
EAB1D2D428AC409F00DAE764 /* LabelViewController.swift in Sources */,
|
||||
EA89204B28B66CE2006B9984 /* ScrollViewKeyboardAvoider.swift in Sources */,
|
||||
EA84F76228BE4AE500D67ABC /* RadioSwatchGroupViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@ -85,7 +85,6 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
|
||||
MenuComponent(title: "RadioButton", completed: true, viewController: RadioButtonViewController.self),
|
||||
MenuComponent(title: "RadioButtonItem", completed: true, viewController: RadioButtonItemViewController.self),
|
||||
MenuComponent(title: "RadioButtonGroup", completed: true, viewController: RadioButtonGroupViewController.self),
|
||||
MenuComponent(title: "RadioSwatchGroup", completed: true, viewController: RadioSwatchGroupViewController.self),
|
||||
//MenuComponent(title: "TabsContainer", completed: false, viewController: TabsContainerViewController.self),
|
||||
MenuComponent(title: "Tabs", completed: true, viewController: TabsViewController.self),
|
||||
MenuComponent(title: "TextArea", completed: false, viewController: TextAreaViewController.self),
|
||||
|
||||
@ -1,158 +0,0 @@
|
||||
//
|
||||
// RadioSwatchGroupViewController.swift
|
||||
// VDSSample
|
||||
//
|
||||
// Created by Matt Bruce on 8/30/22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import VDS
|
||||
import VDSColorTokens
|
||||
import Combine
|
||||
|
||||
class RadioSwatchGroupViewController: BaseViewController<RadioSwatchGroup> {
|
||||
|
||||
var disabledSwitch = Toggle()
|
||||
var strikeThroughSwitch = Toggle()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
addContentTopView(view: component)
|
||||
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func setupForm() {
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||
addFormRow(label: "Strikethrough", view: strikeThroughSwitch)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
strikeThroughSwitch.onChange = { [weak self] sender in
|
||||
self?.component.selectorViews.first?.strikethrough = sender.isOn
|
||||
self?.component.reload()
|
||||
}
|
||||
}
|
||||
|
||||
func setupModel(){
|
||||
|
||||
var radioSwatch1 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch1.fillImage = UIImage(named: "imageSwatch")
|
||||
radioSwatch1.text = "Image"
|
||||
radioSwatch1.inputId = "radioSwatch1"
|
||||
|
||||
var radioSwatch2 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch2.primaryColor = .red
|
||||
radioSwatch2.secondaryColor = .blue
|
||||
radioSwatch2.text = "Red/Blue"
|
||||
radioSwatch2.inputId = "radioSwatch2"
|
||||
|
||||
var radioSwatch3 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch3.primaryColor = .green
|
||||
radioSwatch3.text = "Green"
|
||||
radioSwatch3.inputId = "radioSwatch3"
|
||||
|
||||
var radioSwatch4 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch4.primaryColor = .orange
|
||||
radioSwatch4.text = "Orange"
|
||||
radioSwatch4.inputId = "radioSwatch4"
|
||||
|
||||
var radioSwatch5 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch5.primaryColor = .brown
|
||||
radioSwatch5.text = "Brown"
|
||||
radioSwatch5.inputId = "radioSwatch5"
|
||||
|
||||
var radioSwatch6 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch6.primaryColor = .yellow
|
||||
radioSwatch6.text = "Yellow"
|
||||
radioSwatch6.inputId = "radioSwatch6"
|
||||
|
||||
var radioSwatch7 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch7.primaryColor = .purple
|
||||
radioSwatch7.text = "Puple"
|
||||
radioSwatch7.inputId = "radioSwatch7"
|
||||
|
||||
var radioSwatch8 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch8.primaryColor = .systemPink
|
||||
radioSwatch8.text = "Pink"
|
||||
radioSwatch8.inputId = "radioSwatch8"
|
||||
|
||||
component.selectorModels = [radioSwatch1, radioSwatch2, radioSwatch3, radioSwatch4, radioSwatch5, radioSwatch6, radioSwatch7, radioSwatch8]
|
||||
|
||||
component.onChange = { group in
|
||||
print("Selected: \(group.selectedHandler?.text ?? "none")")
|
||||
}
|
||||
|
||||
//set UI values
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
}
|
||||
|
||||
//Picker
|
||||
func setupPicker(){
|
||||
|
||||
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||
self?.component.surface = item
|
||||
self?.contentTopView.backgroundColor = item.color
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extension RadioSwatchGroupViewController: ComponentSampleable {
|
||||
static func makeSample() -> ComponentSample {
|
||||
let component = Self.makeComponent()
|
||||
|
||||
var radioSwatch1 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch1.fillImage = UIImage(named: "imageSwatch")
|
||||
radioSwatch1.text = "Image"
|
||||
radioSwatch1.inputId = "radioSwatch1"
|
||||
|
||||
var radioSwatch2 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch2.primaryColor = .red
|
||||
radioSwatch2.secondaryColor = .blue
|
||||
radioSwatch2.text = "Red/Blue"
|
||||
radioSwatch2.inputId = "radioSwatch2"
|
||||
|
||||
var radioSwatch3 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch3.primaryColor = .green
|
||||
radioSwatch3.text = "Green"
|
||||
radioSwatch3.inputId = "radioSwatch3"
|
||||
|
||||
var radioSwatch4 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch4.primaryColor = .orange
|
||||
radioSwatch4.text = "Orange"
|
||||
radioSwatch4.inputId = "radioSwatch4"
|
||||
|
||||
var radioSwatch5 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch5.primaryColor = .brown
|
||||
radioSwatch5.text = "Brown"
|
||||
radioSwatch5.inputId = "radioSwatch5"
|
||||
|
||||
var radioSwatch6 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch6.primaryColor = .yellow
|
||||
radioSwatch6.text = "Yellow"
|
||||
radioSwatch6.inputId = "radioSwatch6"
|
||||
|
||||
var radioSwatch7 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch7.primaryColor = .purple
|
||||
radioSwatch7.text = "Puple"
|
||||
radioSwatch7.inputId = "radioSwatch7"
|
||||
|
||||
var radioSwatch8 = RadioSwatchGroup.RadioSwatchModel()
|
||||
radioSwatch8.primaryColor = .systemPink
|
||||
radioSwatch8.text = "Pink"
|
||||
radioSwatch8.inputId = "radioSwatch8"
|
||||
|
||||
component.selectorModels = [radioSwatch1, radioSwatch2, radioSwatch3, radioSwatch4, radioSwatch5, radioSwatch6, radioSwatch7, radioSwatch8]
|
||||
|
||||
return ComponentSample(component: component)
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user