removed allTextFields
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
cee2209dc6
commit
1f2711851c
@ -67,9 +67,6 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
||||
var horizontalPaddingTextField = NumericField()
|
||||
var verticalPaddingTextField = NumericField()
|
||||
var dotSizeTextField = NumericField()
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField, heightTextField, widthTextField, horizontalPaddingTextField, verticalPaddingTextField, dotSizeTextField, leadingCharacterTextField] }
|
||||
|
||||
|
||||
var numberedForm = FormSection().with { $0.title = "Numbered Kind"}
|
||||
var dotForm = FormSection().with { $0.title = "Simple Kind"}
|
||||
|
||||
@ -51,9 +51,7 @@ class BadgeViewController: BaseViewController<Badge> {
|
||||
|
||||
var textField = TextField()
|
||||
var maxWidthTextField = NumericField()
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField, maxWidthTextField] }
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
addContentTopView(view: .makeWrapper(for: component))
|
||||
|
||||
@ -72,7 +72,7 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
|
||||
}
|
||||
|
||||
private let edgeSpacing = 16.0
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Combine Properties
|
||||
//--------------------------------------------------
|
||||
@ -237,14 +237,14 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
|
||||
func keyboardWillShow(notification: UIKit.Notification) {
|
||||
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
|
||||
if let activeTextField, self.view.frame.origin.y == 0, isViewHiddenByKeyboard(view: activeTextField, keyboardFrame: keyboardSize) {
|
||||
self.view.frame.origin.y -= keyboardSize.height
|
||||
view.frame.origin.y -= keyboardSize.height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func keyboardWillHide(notification: UIKit.Notification) {
|
||||
if self.view.frame.origin.y != 0 {
|
||||
self.view.frame.origin.y = 0
|
||||
view.frame.origin.y = 0
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ public class BaseViewController<Component: UIView>: UIViewController, Initable {
|
||||
|
||||
open func setup() {
|
||||
|
||||
if let textFields = allTextFields() {
|
||||
if let textFields = allTextFields()?.filter({ $0.isKind(of: TextField.self) == false || $0.isKind(of: NumericField.self) }) {
|
||||
for textField in textFields {
|
||||
let keypadToolbar: UIToolbar = UIToolbar()
|
||||
|
||||
|
||||
@ -68,8 +68,6 @@ class ButtonGroupViewController: BaseViewController<ButtonGroup> {
|
||||
let largeLabel = Label().with{ $0.text = "Large Button Group"; $0.textStyle = .boldTitleSmall }
|
||||
let smallLabel = Label().with{ $0.text = "Small Button Group"; $0.textStyle = .boldTitleSmall }
|
||||
|
||||
override func allTextFields() -> [TextField]? { [widthTextField, percentageTextField] }
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
@ -43,16 +43,14 @@ class ButtonIconViewController: BaseViewController<ButtonIcon> {
|
||||
items: ButtonIcon.Size.allCases)
|
||||
}()
|
||||
|
||||
var customSizeField = TextField()
|
||||
var centerX = TextField()
|
||||
var centerY = TextField()
|
||||
var customSizeField = NumericField()
|
||||
var centerX = NumericField()
|
||||
var centerY = NumericField()
|
||||
var fitToIcon = Toggle()
|
||||
var floating = Toggle()
|
||||
var hideBorder = Toggle()
|
||||
var disabledSwitch = Toggle()
|
||||
|
||||
override func allTextFields() -> [TextField]? { [customSizeField, centerX, centerY] }
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
addContentTopView(view: .makeWrapper(for: component, edgeSpacing: 16.0), edgeSpacing: 0.0)
|
||||
|
||||
@ -37,8 +37,6 @@ class ButtonViewController: BaseViewController<Button> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField, widthTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Button Action", view: label)
|
||||
|
||||
@ -28,8 +28,6 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, childTextField] }
|
||||
|
||||
override func setupForm() {
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -27,8 +27,6 @@ class CheckboxItemViewController: BaseViewController<CheckboxItem> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, childTextField, errorTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -31,10 +31,8 @@ class IconViewController: BaseViewController<Icon> {
|
||||
items: Icon.Size.allCases)
|
||||
}()
|
||||
|
||||
var customSizeField = TextField()
|
||||
var customSizeField = NumericField()
|
||||
|
||||
override func allTextFields() -> [TextField]? { [customSizeField] }
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
addContentTopView(view: .makeWrapper(for: component))
|
||||
|
||||
@ -37,9 +37,7 @@ class InputFieldViewController: BaseViewController<InputField> {
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, errorTextField, successTextField, helperTextField, widthTextField, tooltipTitleTextField, tooltipContentTextField] }
|
||||
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -27,9 +27,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField, subTextField, subTextRightField] }
|
||||
|
||||
|
||||
override func setupForm() {
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -26,8 +26,6 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, childTextField] }
|
||||
|
||||
override func setupForm() {
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -27,8 +27,6 @@ class RadioButtonItemViewController: BaseViewController<RadioButtonItem> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, childTextField, errorTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -25,9 +25,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
|
||||
var verticalOrientationFormStackView = FormSection()
|
||||
var horizontalOrientationFormStackView = FormSection()
|
||||
var overflowRow: UIView?
|
||||
|
||||
override func allTextFields() -> [TextField]? { [widthValueTextField, widthPercentageTextField] }
|
||||
|
||||
|
||||
lazy var orientationPickerSelectorView = {
|
||||
PickerSelectorView(title: "",
|
||||
picker: self.picker,
|
||||
|
||||
@ -31,9 +31,7 @@ class TextAreaViewController: BaseViewController<TextArea> {
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [labelTextField, errorTextField, helperTextField, widthTextField, tooltipTitleTextField, tooltipContentTextField] }
|
||||
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -30,8 +30,6 @@ class TextLinkCaretViewController: BaseViewController<TextLinkCaret> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Button Action", view: label)
|
||||
|
||||
@ -55,7 +55,6 @@ class TileContainerViewController: BaseViewController<TileContainer> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [widthTextField, heightTextField] }
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
formStackView.addArrangedSubview(Label().with {
|
||||
|
||||
@ -51,9 +51,7 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
setupPicker()
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [titleTextField, subTitleTextField, widthTextField, heightTextField, textWidthTextField, textPercentageTextField, badgeTextField] }
|
||||
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||
|
||||
@ -50,8 +50,6 @@ class TitleLockupViewController: BaseViewController<TitleLockup> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [eyebrowTextField, titleTextField, subTitleTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||
|
||||
@ -41,8 +41,6 @@ class ToggleViewController: BaseViewController<Toggle> {
|
||||
setupPicker()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [onTextField, offTextField] }
|
||||
|
||||
override func setupForm() {
|
||||
super.setupForm()
|
||||
|
||||
|
||||
@ -38,8 +38,6 @@ class TooltipViewController: BaseViewController<Tooltip> {
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [titleTextField, contentTextField, closeButtonTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
@ -46,8 +46,6 @@ class TrailingTooltipLabelViewController: BaseViewController<TrailingTooltipLabe
|
||||
setupModel()
|
||||
}
|
||||
|
||||
override func allTextFields() -> [TextField]? { [textField, titleTextField, contentTextField, closeButtonTextField] }
|
||||
|
||||
override func setupForm(){
|
||||
super.setupForm()
|
||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user