From 3713d200c9cad0bfc34378fdd9d87ca8f9403614 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Wed, 21 Aug 2024 18:34:57 +0530 Subject: [PATCH 01/12] Digital ACT-191 ONEAPP-10586 story: added new page for footnote --- VDSSample.xcodeproj/project.pbxproj | 4 +++ .../FootnoteViewController.swift | 36 +++++++++++++++++++ .../ViewControllers/MenuViewController.swift | 1 + 3 files changed, 41 insertions(+) create mode 100644 VDSSample/ViewControllers/FootnoteViewController.swift diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index 9ad4b88..8f12f19 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -37,6 +37,7 @@ 1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */; }; 184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */; }; 186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; }; + 18926F5F2C76185A00C55BF6 /* FootnoteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */; }; 18A3F1302BD9332500498E4A /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */; }; 18AE87522C06FDD60075F181 /* CarouselViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AE87512C06FDD60075F181 /* CarouselViewController.swift */; }; 440B84CC2BD8E98B004A732A /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 440B84CB2BD8E98B004A732A /* TableViewController.swift */; }; @@ -137,6 +138,7 @@ 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsViewController.swift; sourceTree = ""; }; 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLockupViewController.swift; sourceTree = ""; }; 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = ""; }; + 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteViewController.swift; sourceTree = ""; }; 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = ""; }; 18AE87512C06FDD60075F181 /* CarouselViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselViewController.swift; sourceTree = ""; }; 440B84CB2BD8E98B004A732A /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; @@ -341,6 +343,7 @@ EA0D1C2E2A66CFE900E5C127 /* CheckboxViewController.swift */, EA1758452BC8893700A5C0D9 /* DatePickerViewController.swift */, 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */, + 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */, EA985C00296CC21C00F2FF2E /* IconViewController.swift */, 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */, EAA5EEAC28EB6924003B3210 /* InputFieldViewController.swift */, @@ -567,6 +570,7 @@ EA985C20296DECF600F2FF2E /* IconName.swift in Sources */, EA89204928B66CE2006B9984 /* KeyboardFrameChangeListening.swift in Sources */, EA5F86CE2A1E863F00BC83E4 /* TabsContainerViewController.swift in Sources */, + 18926F5F2C76185A00C55BF6 /* FootnoteViewController.swift in Sources */, EA985C01296CC21C00F2FF2E /* IconViewController.swift in Sources */, 184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */, EAC9258029119FC400091998 /* TextLinkViewController.swift in Sources */, diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift new file mode 100644 index 0000000..edbd25f --- /dev/null +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -0,0 +1,36 @@ +// +// FootnoteViewController.swift +// VDSSample +// +// Created by Kanamarlapudi, Vasavi on 21/08/24. +// + +import Foundation +import UIKit +import VDS + +class FootnoteViewController: BaseViewController { + + override func viewDidLoad() { + super.viewDidLoad() + addContentTopView(view: component) + setupPicker() + setupModel() + } + + override func setupForm() { + super.setupForm() + addFormRow(label: "Surface", view: surfacePickerSelectorView) + + } + + func setupModel() { + } + + func setupPicker() { + surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.surface = item + self?.contentTopView.backgroundColor = item.color + } + } +} diff --git a/VDSSample/ViewControllers/MenuViewController.swift b/VDSSample/ViewControllers/MenuViewController.swift index 00bf63c..26ca468 100644 --- a/VDSSample/ViewControllers/MenuViewController.swift +++ b/VDSSample/ViewControllers/MenuViewController.swift @@ -82,6 +82,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable { MenuComponent(title: "CheckboxGroup", completed: true, viewController: CheckboxGroupViewController.self), MenuComponent(title: "DatePicker", completed: true, viewController: DatePickerViewController.self), MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self), + MenuComponent(title: "Footnote", completed: false, viewController: FootnoteViewController.self), MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self), MenuComponent(title: "InputField", completed: true, viewController: InputFieldViewController.self), MenuComponent(title: "InputStepper", completed: true, viewController: InputStepperViewController.self), From 0f5bef548aa4f9f4c5cebd786b591ab52a70b194 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Thu, 22 Aug 2024 17:10:21 +0530 Subject: [PATCH 02/12] Digital ACT-191 ONEAPP-10586 story: did setup form and model to pass values to the properties --- .../FootnoteViewController.swift | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift index edbd25f..155136a 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -11,6 +11,28 @@ import VDS class FootnoteViewController: BaseViewController { + lazy var kindPickerSelectorView = { + PickerSelectorView(title: "secondary", + picker: self.picker, + items: Footnote.Kind.allCases) + }() + + lazy var symbolTypePickerSelectorView = { + PickerSelectorView(title: "asterisk", + picker: self.picker, + items: Footnote.SymbolType.allCases) + }() + + lazy var sizePickerSelectorView = { + PickerSelectorView(title: "micro", + picker: self.picker, + items: Footnote.Size.allCases) + }() + + var hideSymbolSwitch = Toggle() + var widthTextField = NumericField() + var percentageTextField = NumericField() + override func viewDidLoad() { super.viewDidLoad() addContentTopView(view: component) @@ -21,10 +43,47 @@ class FootnoteViewController: BaseViewController { override func setupForm() { super.setupForm() addFormRow(label: "Surface", view: surfacePickerSelectorView) + addFormRow(label: "Kind", view: kindPickerSelectorView) + addFormRow(label: "Size", view: sizePickerSelectorView) + addFormRow(label: "Symbol Type", view: symbolTypePickerSelectorView) + addFormRow(label: "Hide Symbol", view: hideSymbolSwitch) + addFormRow(label: "Width", view: widthTextField) + addFormRow(label: "Percentage (1-100)", view: percentageTextField) + hideSymbolSwitch.publisher(for: .valueChanged).sink { [weak self] control in + self?.component.hideSymbol = control.isOn + }.store(in: &subscribers) + + widthTextField + .numberPublisher + .sink { [weak self] number in + if let number { + self?.component.width = .value(number.cgFloatValue) + self?.percentageTextField.text = "" + } else { + self?.component.width = nil + } + }.store(in: &subscribers) + + percentageTextField + .numberPublisher + .sink { [weak self] number in + if let number { + self?.component.width = .percentage(number.cgFloatValue) + self?.widthTextField.text = "" + } else { + self?.component.width = nil + } + }.store(in: &subscribers) + } func setupModel() { + component.text = "Service is included for free for two years with activation of any iPhone15 model. Connection and response times vary based on location, site conditions, and other factors. See support.apple.com/en-us/HT213885 for more information." + + sizePickerSelectorView.text = component.size.rawValue + kindPickerSelectorView.text = component.kind.rawValue + symbolTypePickerSelectorView.text = component.symbolType.rawValue } func setupPicker() { @@ -32,5 +91,17 @@ class FootnoteViewController: BaseViewController { self?.component.surface = item self?.contentTopView.backgroundColor = item.color } + + kindPickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.kind = item + } + + sizePickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.size = item + } + + symbolTypePickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.symbolType = item + } } } From fe4df9d1a09124333cf8eb23b13511e54e68f291 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Thu, 29 Aug 2024 19:10:28 +0530 Subject: [PATCH 03/12] Digital ACT-191 ONEAPP-10586 story: updating component with tooltipmodel --- VDSSample/ViewControllers/FootnoteViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift index 155136a..ab74405 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -80,7 +80,8 @@ class FootnoteViewController: BaseViewController { func setupModel() { component.text = "Service is included for free for two years with activation of any iPhone15 model. Connection and response times vary based on location, site conditions, and other factors. See support.apple.com/en-us/HT213885 for more information." - + component.tooltipModel = .init(title: "Check your item.", content:"Here is the content for your item.") + sizePickerSelectorView.text = component.size.rawValue kindPickerSelectorView.text = component.kind.rawValue symbolTypePickerSelectorView.text = component.symbolType.rawValue From 062212e6478104a12a47960e1fa13587044841f1 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Mon, 2 Sep 2024 11:34:54 +0530 Subject: [PATCH 04/12] Digital ACT-191 ONEAPP-10586 story: added new page for footnote group --- VDSSample.xcodeproj/project.pbxproj | 4 ++ .../FootnoteGroupViewController.swift | 69 +++++++++++++++++++ .../FootnoteViewController.swift | 2 +- .../ViewControllers/MenuViewController.swift | 1 + 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 VDSSample/ViewControllers/FootnoteGroupViewController.swift diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index 8f12f19..280135f 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -35,6 +35,7 @@ 180636CB2C29B12B00C92D86 /* InputStepperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */; }; 1808BEBE2BA4479500129230 /* CarouselScrollbarViewConttroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1808BEBD2BA4479500129230 /* CarouselScrollbarViewConttroller.swift */; }; 1832AC5B2BA1347B008AE476 /* BreadcrumbsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */; }; + 183B16F52C80B27C00BA6A10 /* FootnoteGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */; }; 184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */; }; 186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; }; 18926F5F2C76185A00C55BF6 /* FootnoteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */; }; @@ -136,6 +137,7 @@ 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputStepperViewController.swift; sourceTree = ""; }; 1808BEBD2BA4479500129230 /* CarouselScrollbarViewConttroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselScrollbarViewConttroller.swift; sourceTree = ""; }; 1832AC5A2BA1347B008AE476 /* BreadcrumbsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsViewController.swift; sourceTree = ""; }; + 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteGroupViewController.swift; sourceTree = ""; }; 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLockupViewController.swift; sourceTree = ""; }; 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = ""; }; 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteViewController.swift; sourceTree = ""; }; @@ -344,6 +346,7 @@ EA1758452BC8893700A5C0D9 /* DatePickerViewController.swift */, 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */, 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */, + 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */, EA985C00296CC21C00F2FF2E /* IconViewController.swift */, 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */, EAA5EEAC28EB6924003B3210 /* InputFieldViewController.swift */, @@ -562,6 +565,7 @@ 18AE87522C06FDD60075F181 /* CarouselViewController.swift in Sources */, EA596ABA2A16B2ED00300C4B /* TabsViewController.swift in Sources */, EA89204E28B67332006B9984 /* CheckBoxGroupViewController.swift in Sources */, + 183B16F52C80B27C00BA6A10 /* FootnoteGroupViewController.swift in Sources */, EAA5EEAD28EB6924003B3210 /* InputFieldViewController.swift in Sources */, 440B84CC2BD8E98B004A732A /* TableViewController.swift in Sources */, EA985C25296E06EA00F2FF2E /* TextAreaViewController.swift in Sources */, diff --git a/VDSSample/ViewControllers/FootnoteGroupViewController.swift b/VDSSample/ViewControllers/FootnoteGroupViewController.swift new file mode 100644 index 0000000..ec083f3 --- /dev/null +++ b/VDSSample/ViewControllers/FootnoteGroupViewController.swift @@ -0,0 +1,69 @@ +// +// FootnoteGroupViewController.swift +// VDSSample +// +// Created by Kanamarlapudi, Vasavi on 29/08/24. +// + +import Foundation +import UIKit +import VDS + +class FootnoteGroupViewController: BaseViewController { + + var widthTextField = NumericField() + var percentageTextField = NumericField() + var footnotes: [Footnote] = [] + + override func viewDidLoad() { + super.viewDidLoad() + addContentTopView(view: component) + setupPicker() + setupModel() + } + + override func setupForm() { + super.setupForm() + addFormRow(label: "Surface", view: surfacePickerSelectorView) + addFormRow(label: "Width", view: widthTextField) + addFormRow(label: "Percentage (1-100)", view: percentageTextField) + + widthTextField + .numberPublisher + .sink { [weak self] number in + if let number { + self?.component.width = .value(number.cgFloatValue) + self?.percentageTextField.text = "" + } else { + self?.component.width = nil + } + }.store(in: &subscribers) + + percentageTextField + .numberPublisher + .sink { [weak self] number in + if let number, number.intValue > 9 { + self?.component.width = .percentage(number.cgFloatValue) + self?.widthTextField.text = "" + } else { + self?.component.width = nil + } + }.store(in: &subscribers) + + } + + func setupModel() { + let toolTipModel = Tooltip.TooltipModel.init(title: "Check your item.", content:"Here is the content for your item.") + footnotes.append(Footnote().with { $0.text = "Offer you best deals on phones, tablets, home, internet and more. Pre order the new version mobiles and get off *T&C apply."; $0.symbolType = .asterisk; $0.kind = .primary; $0.tooltipModel = toolTipModel}) + footnotes.append(Footnote().with { $0.text = "The display has rounded corners. When measured as a standard rectangular shape, the screen is 6.68 inches diagonally. Actual viewable area is less."; $0.symbolType = .doubleAsterisk; $0.kind = .primary}) + footnotes.append(Footnote().with { $0.text = " Some features may not be available for all countries or all areas."; $0.symbolType = .character; $0.kind = .primary}) + component.footnoteitems = footnotes + } + + func setupPicker() { + surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in + self?.component.surface = item + self?.contentTopView.backgroundColor = item.color + } + } +} diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift index ab74405..4da0da6 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -68,7 +68,7 @@ class FootnoteViewController: BaseViewController { percentageTextField .numberPublisher .sink { [weak self] number in - if let number { + if let number, number.intValue > 9 { self?.component.width = .percentage(number.cgFloatValue) self?.widthTextField.text = "" } else { diff --git a/VDSSample/ViewControllers/MenuViewController.swift b/VDSSample/ViewControllers/MenuViewController.swift index 26ca468..1475bed 100644 --- a/VDSSample/ViewControllers/MenuViewController.swift +++ b/VDSSample/ViewControllers/MenuViewController.swift @@ -83,6 +83,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable { MenuComponent(title: "DatePicker", completed: true, viewController: DatePickerViewController.self), MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self), MenuComponent(title: "Footnote", completed: false, viewController: FootnoteViewController.self), + MenuComponent(title: "FootnoteGroup", completed: false, viewController: FootnoteGroupViewController.self), MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self), MenuComponent(title: "InputField", completed: true, viewController: InputFieldViewController.self), MenuComponent(title: "InputStepper", completed: true, viewController: InputStepperViewController.self), From 7343b670e9a631609b7f7277674bc833fcd17ed5 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Thu, 12 Sep 2024 13:24:19 +0530 Subject: [PATCH 05/12] Digital ACT-191 ONEAPP-10586 story: updated symbolType to use as String, and camelCase applied to footnoteItems --- .../FootnoteGroupViewController.swift | 8 +++--- .../FootnoteViewController.swift | 26 ++++++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/VDSSample/ViewControllers/FootnoteGroupViewController.swift b/VDSSample/ViewControllers/FootnoteGroupViewController.swift index ec083f3..c88a70c 100644 --- a/VDSSample/ViewControllers/FootnoteGroupViewController.swift +++ b/VDSSample/ViewControllers/FootnoteGroupViewController.swift @@ -54,10 +54,10 @@ class FootnoteGroupViewController: BaseViewController { func setupModel() { let toolTipModel = Tooltip.TooltipModel.init(title: "Check your item.", content:"Here is the content for your item.") - footnotes.append(Footnote().with { $0.text = "Offer you best deals on phones, tablets, home, internet and more. Pre order the new version mobiles and get off *T&C apply."; $0.symbolType = .asterisk; $0.kind = .primary; $0.tooltipModel = toolTipModel}) - footnotes.append(Footnote().with { $0.text = "The display has rounded corners. When measured as a standard rectangular shape, the screen is 6.68 inches diagonally. Actual viewable area is less."; $0.symbolType = .doubleAsterisk; $0.kind = .primary}) - footnotes.append(Footnote().with { $0.text = " Some features may not be available for all countries or all areas."; $0.symbolType = .character; $0.kind = .primary}) - component.footnoteitems = footnotes + footnotes.append(Footnote().with { $0.text = "Offer you best deals on phones, tablets, home, internet and more. Pre order the new version mobiles and get off *T&C apply."; $0.symbolType = "*"; $0.kind = .primary; $0.tooltipModel = toolTipModel}) + footnotes.append(Footnote().with { $0.text = "The display has rounded corners. When measured as a standard rectangular shape, the screen is 6.68 inches diagonally. Actual viewable area is less."; $0.symbolType = "**"; $0.kind = .primary}) + footnotes.append(Footnote().with { $0.text = " Some features may not be available for all countries or all areas."; $0.symbolType = "1."; $0.kind = .primary}) + component.footnoteItems = footnotes } func setupPicker() { diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift index 4da0da6..5c4afd0 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -11,6 +11,26 @@ import VDS class FootnoteViewController: BaseViewController { + internal enum SymbolType: String, DefaultValuing, CaseIterable { + case asterisk + case doubleAsterisk + case character + + public static var defaultValue: Self { .asterisk } + + /// TextStyle relative to Size. + public var text: String { + switch self { + case .asterisk: + return "*" + case .doubleAsterisk: + return "**" + case .character: + return "1." + } + } + } + lazy var kindPickerSelectorView = { PickerSelectorView(title: "secondary", picker: self.picker, @@ -20,7 +40,7 @@ class FootnoteViewController: BaseViewController { lazy var symbolTypePickerSelectorView = { PickerSelectorView(title: "asterisk", picker: self.picker, - items: Footnote.SymbolType.allCases) + items: SymbolType.allCases) }() lazy var sizePickerSelectorView = { @@ -84,7 +104,7 @@ class FootnoteViewController: BaseViewController { sizePickerSelectorView.text = component.size.rawValue kindPickerSelectorView.text = component.kind.rawValue - symbolTypePickerSelectorView.text = component.symbolType.rawValue + symbolTypePickerSelectorView.text = SymbolType.defaultValue.text } func setupPicker() { @@ -102,7 +122,7 @@ class FootnoteViewController: BaseViewController { } symbolTypePickerSelectorView.onPickerDidSelect = { [weak self] item in - self?.component.symbolType = item + self?.component.symbolType = item.text } } } From 192279158096b773d1565dfac8d2010c62cc4239 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Wed, 18 Sep 2024 12:22:35 +0530 Subject: [PATCH 06/12] Digital ACT-191 ONEAPP-10586 story: addressing feedback - Added textfield for footnote text, tooltip title and content. Removed 'hideSymbol'. Added 'none' to set empty text to symbolType. --- .../FootnoteViewController.swift | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteViewController.swift index 5c4afd0..e175c59 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteViewController.swift @@ -15,6 +15,7 @@ class FootnoteViewController: BaseViewController { case asterisk case doubleAsterisk case character + case none public static var defaultValue: Self { .asterisk } @@ -27,6 +28,8 @@ class FootnoteViewController: BaseViewController { return "**" case .character: return "1." + case .none: + return "" } } } @@ -49,9 +52,11 @@ class FootnoteViewController: BaseViewController { items: Footnote.Size.allCases) }() - var hideSymbolSwitch = Toggle() + var footnoteTextField = TextField() var widthTextField = NumericField() var percentageTextField = NumericField() + var tooltipTitleTextField = TextField() + var tooltipContentTextField = TextField() override func viewDidLoad() { super.viewDidLoad() @@ -66,13 +71,17 @@ class FootnoteViewController: BaseViewController { addFormRow(label: "Kind", view: kindPickerSelectorView) addFormRow(label: "Size", view: sizePickerSelectorView) addFormRow(label: "Symbol Type", view: symbolTypePickerSelectorView) - addFormRow(label: "Hide Symbol", view: hideSymbolSwitch) + addFormRow(label: "Text", view: footnoteTextField) addFormRow(label: "Width", view: widthTextField) addFormRow(label: "Percentage (1-100)", view: percentageTextField) - - hideSymbolSwitch.publisher(for: .valueChanged).sink { [weak self] control in - self?.component.hideSymbol = control.isOn - }.store(in: &subscribers) + addFormRow(label: "ToolTip Title", view: tooltipTitleTextField) + addFormRow(label: "ToolTip Content", view: tooltipContentTextField) + + footnoteTextField + .textPublisher + .sink { [weak self] text in + self?.component.text = text + }.store(in: &subscribers) widthTextField .numberPublisher @@ -96,15 +105,29 @@ class FootnoteViewController: BaseViewController { } }.store(in: &subscribers) + tooltipTitleTextField + .textPublisher + .sink { [weak self] text in + self?.updateTooltip() + }.store(in: &subscribers) + + tooltipContentTextField + .textPublisher + .sink { [weak self] text in + self?.updateTooltip() + }.store(in: &subscribers) } func setupModel() { component.text = "Service is included for free for two years with activation of any iPhone15 model. Connection and response times vary based on location, site conditions, and other factors. See support.apple.com/en-us/HT213885 for more information." - component.tooltipModel = .init(title: "Check your item.", content:"Here is the content for your item.") + component.tooltipModel = nil + footnoteTextField.text = component.text sizePickerSelectorView.text = component.size.rawValue kindPickerSelectorView.text = component.kind.rawValue symbolTypePickerSelectorView.text = SymbolType.defaultValue.text + tooltipTitleTextField.text = component.tooltipModel?.title + tooltipContentTextField.text = component.tooltipModel?.content } func setupPicker() { @@ -125,4 +148,13 @@ class FootnoteViewController: BaseViewController { self?.component.symbolType = item.text } } + + func updateTooltip() { + let title = tooltipTitleTextField.text ?? "" + let content = tooltipContentTextField.text ?? "" + + component.tooltipModel = !title.isEmpty || !content.isEmpty ? .init(title: title, + content: content) : nil + } + } From adb30de38ca19c1867e05457681a508880884333 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 18 Sep 2024 14:56:40 -0500 Subject: [PATCH 07/12] refactored naming of Footnote to FootnoteItem Signed-off-by: Matt Bruce --- VDSSample.xcodeproj/project.pbxproj | 8 ++++---- .../ViewControllers/FootnoteGroupViewController.swift | 8 ++++---- ...wController.swift => FootnoteItemViewController.swift} | 6 +++--- VDSSample/ViewControllers/MenuViewController.swift | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename VDSSample/ViewControllers/{FootnoteViewController.swift => FootnoteItemViewController.swift} (96%) diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index 7d4ebd2..ebe2758 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -38,7 +38,7 @@ 183B16F52C80B27C00BA6A10 /* FootnoteGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */; }; 184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */; }; 186D13CD2BBA990800986B53 /* DropdownSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */; }; - 18926F5F2C76185A00C55BF6 /* FootnoteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */; }; + 18926F5F2C76185A00C55BF6 /* FootnoteItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */; }; 18A3F1302BD9332500498E4A /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */; }; 18AE87522C06FDD60075F181 /* CarouselViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AE87512C06FDD60075F181 /* CarouselViewController.swift */; }; 440B84CC2BD8E98B004A732A /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 440B84CB2BD8E98B004A732A /* TableViewController.swift */; }; @@ -140,7 +140,7 @@ 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteGroupViewController.swift; sourceTree = ""; }; 184023482C61E9E700A412C8 /* PriceLockupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceLockupViewController.swift; sourceTree = ""; }; 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelectViewController.swift; sourceTree = ""; }; - 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteViewController.swift; sourceTree = ""; }; + 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteItemViewController.swift; sourceTree = ""; }; 18A3F12F2BD9332500498E4A /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = ""; }; 18AE87512C06FDD60075F181 /* CarouselViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselViewController.swift; sourceTree = ""; }; 440B84CB2BD8E98B004A732A /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; @@ -345,7 +345,7 @@ EA0D1C2E2A66CFE900E5C127 /* CheckboxViewController.swift */, EA1758452BC8893700A5C0D9 /* DatePickerViewController.swift */, 186D13CC2BBA990800986B53 /* DropdownSelectViewController.swift */, - 18926F5E2C76185A00C55BF6 /* FootnoteViewController.swift */, + 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */, 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */, EA985C00296CC21C00F2FF2E /* IconViewController.swift */, 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */, @@ -574,7 +574,7 @@ EA985C20296DECF600F2FF2E /* IconName.swift in Sources */, EA89204928B66CE2006B9984 /* KeyboardFrameChangeListening.swift in Sources */, EA5F86CE2A1E863F00BC83E4 /* TabsContainerViewController.swift in Sources */, - 18926F5F2C76185A00C55BF6 /* FootnoteViewController.swift in Sources */, + 18926F5F2C76185A00C55BF6 /* FootnoteItemViewController.swift in Sources */, EA985C01296CC21C00F2FF2E /* IconViewController.swift in Sources */, 184023492C61E9E700A412C8 /* PriceLockupViewController.swift in Sources */, EAC9258029119FC400091998 /* TextLinkViewController.swift in Sources */, diff --git a/VDSSample/ViewControllers/FootnoteGroupViewController.swift b/VDSSample/ViewControllers/FootnoteGroupViewController.swift index c88a70c..b2a1c83 100644 --- a/VDSSample/ViewControllers/FootnoteGroupViewController.swift +++ b/VDSSample/ViewControllers/FootnoteGroupViewController.swift @@ -13,7 +13,7 @@ class FootnoteGroupViewController: BaseViewController { var widthTextField = NumericField() var percentageTextField = NumericField() - var footnotes: [Footnote] = [] + var footnotes: [FootnoteItem] = [] override func viewDidLoad() { super.viewDidLoad() @@ -54,9 +54,9 @@ class FootnoteGroupViewController: BaseViewController { func setupModel() { let toolTipModel = Tooltip.TooltipModel.init(title: "Check your item.", content:"Here is the content for your item.") - footnotes.append(Footnote().with { $0.text = "Offer you best deals on phones, tablets, home, internet and more. Pre order the new version mobiles and get off *T&C apply."; $0.symbolType = "*"; $0.kind = .primary; $0.tooltipModel = toolTipModel}) - footnotes.append(Footnote().with { $0.text = "The display has rounded corners. When measured as a standard rectangular shape, the screen is 6.68 inches diagonally. Actual viewable area is less."; $0.symbolType = "**"; $0.kind = .primary}) - footnotes.append(Footnote().with { $0.text = " Some features may not be available for all countries or all areas."; $0.symbolType = "1."; $0.kind = .primary}) + footnotes.append(.init().with { $0.text = "Offer you best deals on phones, tablets, home, internet and more. Pre order the new version mobiles and get off *T&C apply."; $0.symbolType = "*"; $0.kind = .primary; $0.tooltipModel = toolTipModel}) + footnotes.append(.init().with { $0.text = "The display has rounded corners. When measured as a standard rectangular shape, the screen is 6.68 inches diagonally. Actual viewable area is less."; $0.symbolType = "**"; $0.kind = .primary}) + footnotes.append(.init().with { $0.text = "Some features may not be available for all countries or all areas."; $0.symbolType = "1."; $0.kind = .primary}) component.footnoteItems = footnotes } diff --git a/VDSSample/ViewControllers/FootnoteViewController.swift b/VDSSample/ViewControllers/FootnoteItemViewController.swift similarity index 96% rename from VDSSample/ViewControllers/FootnoteViewController.swift rename to VDSSample/ViewControllers/FootnoteItemViewController.swift index e175c59..de1b3e5 100644 --- a/VDSSample/ViewControllers/FootnoteViewController.swift +++ b/VDSSample/ViewControllers/FootnoteItemViewController.swift @@ -9,7 +9,7 @@ import Foundation import UIKit import VDS -class FootnoteViewController: BaseViewController { +class FootnoteItemViewController: BaseViewController { internal enum SymbolType: String, DefaultValuing, CaseIterable { case asterisk @@ -37,7 +37,7 @@ class FootnoteViewController: BaseViewController { lazy var kindPickerSelectorView = { PickerSelectorView(title: "secondary", picker: self.picker, - items: Footnote.Kind.allCases) + items: FootnoteItem.Kind.allCases) }() lazy var symbolTypePickerSelectorView = { @@ -49,7 +49,7 @@ class FootnoteViewController: BaseViewController { lazy var sizePickerSelectorView = { PickerSelectorView(title: "micro", picker: self.picker, - items: Footnote.Size.allCases) + items: FootnoteItem.Size.allCases) }() var footnoteTextField = TextField() diff --git a/VDSSample/ViewControllers/MenuViewController.swift b/VDSSample/ViewControllers/MenuViewController.swift index 1475bed..94c9190 100644 --- a/VDSSample/ViewControllers/MenuViewController.swift +++ b/VDSSample/ViewControllers/MenuViewController.swift @@ -82,7 +82,7 @@ class MenuViewController: UITableViewController, TooltipLaunchable { MenuComponent(title: "CheckboxGroup", completed: true, viewController: CheckboxGroupViewController.self), MenuComponent(title: "DatePicker", completed: true, viewController: DatePickerViewController.self), MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self), - MenuComponent(title: "Footnote", completed: false, viewController: FootnoteViewController.self), + MenuComponent(title: "FootnoteItem", completed: false, viewController: FootnoteItemViewController.self), MenuComponent(title: "FootnoteGroup", completed: false, viewController: FootnoteGroupViewController.self), MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self), MenuComponent(title: "InputField", completed: true, viewController: InputFieldViewController.self), From efc5f6b58d348f42bac132eea2c20f7b9e84d9b0 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 18 Sep 2024 14:59:18 -0500 Subject: [PATCH 08/12] added back hideSymbol Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/FootnoteItemViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/VDSSample/ViewControllers/FootnoteItemViewController.swift b/VDSSample/ViewControllers/FootnoteItemViewController.swift index de1b3e5..9483402 100644 --- a/VDSSample/ViewControllers/FootnoteItemViewController.swift +++ b/VDSSample/ViewControllers/FootnoteItemViewController.swift @@ -52,6 +52,7 @@ class FootnoteItemViewController: BaseViewController { items: FootnoteItem.Size.allCases) }() + var hideSymbolSwitch = Toggle() var footnoteTextField = TextField() var widthTextField = NumericField() var percentageTextField = NumericField() @@ -71,11 +72,16 @@ class FootnoteItemViewController: BaseViewController { addFormRow(label: "Kind", view: kindPickerSelectorView) addFormRow(label: "Size", view: sizePickerSelectorView) addFormRow(label: "Symbol Type", view: symbolTypePickerSelectorView) + addFormRow(label: "Hide Symbol", view: hideSymbolSwitch) addFormRow(label: "Text", view: footnoteTextField) addFormRow(label: "Width", view: widthTextField) addFormRow(label: "Percentage (1-100)", view: percentageTextField) addFormRow(label: "ToolTip Title", view: tooltipTitleTextField) addFormRow(label: "ToolTip Content", view: tooltipContentTextField) + + hideSymbolSwitch.publisher(for: .valueChanged).sink { [weak self] control in + self?.component.hideSymbol = control.isOn + }.store(in: &subscribers) footnoteTextField .textPublisher From 3d82b327d2964ea3680e305037b7c2200c074cc7 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 18 Sep 2024 15:19:52 -0500 Subject: [PATCH 09/12] changed to completed Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/MenuViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDSSample/ViewControllers/MenuViewController.swift b/VDSSample/ViewControllers/MenuViewController.swift index 94c9190..77ab906 100644 --- a/VDSSample/ViewControllers/MenuViewController.swift +++ b/VDSSample/ViewControllers/MenuViewController.swift @@ -82,8 +82,8 @@ class MenuViewController: UITableViewController, TooltipLaunchable { MenuComponent(title: "CheckboxGroup", completed: true, viewController: CheckboxGroupViewController.self), MenuComponent(title: "DatePicker", completed: true, viewController: DatePickerViewController.self), MenuComponent(title: "DropdownSelect", completed: true, viewController: DropdownSelectViewController.self), - MenuComponent(title: "FootnoteItem", completed: false, viewController: FootnoteItemViewController.self), - MenuComponent(title: "FootnoteGroup", completed: false, viewController: FootnoteGroupViewController.self), + MenuComponent(title: "FootnoteItem", completed: true, viewController: FootnoteItemViewController.self), + MenuComponent(title: "FootnoteGroup", completed: true, viewController: FootnoteGroupViewController.self), MenuComponent(title: "Icon", completed: true, viewController: IconViewController.self), MenuComponent(title: "InputField", completed: true, viewController: InputFieldViewController.self), MenuComponent(title: "InputStepper", completed: true, viewController: InputStepperViewController.self), From 58125423c9f94e5295ea25e37bc9a864a49d6260 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 19 Sep 2024 09:43:00 -0500 Subject: [PATCH 10/12] fixed issue with toggles in the UI sample Signed-off-by: Matt Bruce --- VDSSample.xcodeproj/project.pbxproj | 4 ++-- .../BadgeIndicatorViewController.swift | 4 ++-- .../ViewControllers/BaseViewController.swift | 10 ++++---- .../BreadcrumbsViewController.swift | 4 ++-- .../ButtonGroupViewController.swift | 2 +- .../ButtonIconViewController.swift | 12 +++++----- .../ButtonViewController.swift | 2 +- .../CalendarViewController.swift | 16 ++++++------- .../CarouselViewController.swift | 2 +- .../CheckBoxGroupViewController.swift | 4 ++-- .../CheckboxItemViewController.swift | 4 ++-- .../CheckboxViewController.swift | 4 ++-- .../DatePickerViewController.swift | 24 +++++++++---------- .../DropdownSelectViewController.swift | 14 +++++------ .../FootnoteItemViewController.swift | 2 +- .../InputFieldViewController.swift | 12 +++++----- .../InputStepperViewController.swift | 8 +++---- .../ViewControllers/LabelViewController.swift | 4 ++-- .../LoaderViewController.swift | 4 ++-- .../NotificationViewController.swift | 4 ++-- .../PriceLockupViewController.swift | 8 +++---- .../RadioBoxGroupViewController.swift | 4 ++-- .../RadioButtonGroupViewController.swift | 4 ++-- .../RadioButtonItemViewController.swift | 4 ++-- .../RadioButtonViewController.swift | 4 ++-- .../ViewControllers/TableViewController.swift | 4 ++-- .../TabsContainerViewController.swift | 6 ++--- .../ViewControllers/TabsViewController.swift | 6 ++--- .../TextAreaViewController.swift | 10 ++++---- .../TextLinkCaretViewController.swift | 2 +- .../TextLinkViewController.swift | 2 +- .../TileContainerViewController.swift | 10 ++++---- .../TileletViewController.swift | 16 ++++++------- .../TitleLockupViewController.swift | 4 ++-- .../ToggleViewController.swift | 4 ++-- .../TooltipViewController.swift | 2 +- .../TrailingTooltipLabelViewController.swift | 4 ++-- 37 files changed, 117 insertions(+), 117 deletions(-) diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index ebe2758..641c602 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -348,8 +348,8 @@ 18926F5E2C76185A00C55BF6 /* FootnoteItemViewController.swift */, 183B16F42C80B27C00BA6A10 /* FootnoteGroupViewController.swift */, EA985C00296CC21C00F2FF2E /* IconViewController.swift */, - 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */, EAA5EEAC28EB6924003B3210 /* InputFieldViewController.swift */, + 180636CA2C29B12B00C92D86 /* InputStepperViewController.swift */, EAB1D2D328AC409F00DAE764 /* LabelViewController.swift */, 44604AD829CE1CF900E62B51 /* LineViewController.swift */, EAD0688F2A55FC11002E3A2D /* LoaderViewController.swift */, @@ -364,8 +364,8 @@ EA5F86CD2A1E863F00BC83E4 /* TabsContainerViewController.swift */, EA596AB92A16B2ED00300C4B /* TabsViewController.swift */, EA985C24296E06EA00F2FF2E /* TextAreaViewController.swift */, - EA0FC2C02912DC5500DF80B4 /* TextLinkCaretViewController.swift */, EAC9257F29119FC400091998 /* TextLinkViewController.swift */, + EA0FC2C02912DC5500DF80B4 /* TextLinkCaretViewController.swift */, EA5E304F294D11540082B959 /* TileContainerViewController.swift */, EA5E305B295111050082B959 /* TileletViewController.swift */, EA5E30542950EA6E0082B959 /* TitleLockupViewController.swift */, diff --git a/VDSSample/ViewControllers/BadgeIndicatorViewController.swift b/VDSSample/ViewControllers/BadgeIndicatorViewController.swift index 399454d..11368cb 100644 --- a/VDSSample/ViewControllers/BadgeIndicatorViewController.swift +++ b/VDSSample/ViewControllers/BadgeIndicatorViewController.swift @@ -82,13 +82,13 @@ class BadgeIndicatorViewController: BaseViewController { addFormRow(label: "Vertical Padding", view: verticalPaddingTextField) addFormRow(label: "Fill Color", view: fillColorPickerSelectorView) addFormRow(label: "Surface", view: surfacePickerSelectorView) - addFormRow(label: "Hide Border", view: hideBorderSwitch) + addFormRow(label: "Hide Border", view: hideBorderSwitch, pinTrailing: false) addFormRow(label: "Border Light", view: borderColorLightPickerSelectorView) addFormRow(label: "Border Dark", view: borderColorDarkPickerSelectorView) addFormRow(label: "Size", view: textSizePickerSelectorView) addFormRow(label: "Accessiblity Text", view: accessibilityTextField) - dotForm.addFormRow(label: "Hide Dot", view: hideDotSwitch) + dotForm.addFormRow(label: "Hide Dot", view: hideDotSwitch, pinTrailing: false) dotForm.addFormRow(label: "Dot Size", view: dotSizeTextField) numberedForm.addFormRow(label: "Leading Character", view: leadingCharacterTextField) numberedForm.addFormRow(label: "Trailing Text", view: trailingTextField) diff --git a/VDSSample/ViewControllers/BaseViewController.swift b/VDSSample/ViewControllers/BaseViewController.swift index 3fb217d..837751c 100644 --- a/VDSSample/ViewControllers/BaseViewController.swift +++ b/VDSSample/ViewControllers/BaseViewController.swift @@ -43,7 +43,7 @@ public class FormSection: UIStackView { } @discardableResult - open func addFormRow(label: String, tooltip: Tooltip.TooltipModel? = nil, view: UIView) -> UIView { + open func addFormRow(label: String, tooltip: Tooltip.TooltipModel? = nil, view: UIView, pinTrailing: Bool = true) -> UIView { let formRow = UIStackView().with { $0.translatesAutoresizingMaskIntoConstraints = false $0.alignment = .fill @@ -63,7 +63,7 @@ public class FormSection: UIStackView { } formRow.addArrangedSubview(label) - formRow.addArrangedSubview(view) + formRow.addArrangedSubview(pinTrailing ? view : .makeWrapper(for: view, edgeSpacing: 0)) addArrangedSubview(formRow) return formRow @@ -311,7 +311,7 @@ public class BaseViewController: UIViewController, Initable , } public func setupForm() { - addFormRow(label: "Show Bounds", view: debugViewSwitch) + addFormRow(label: "Show Bounds", view: debugViewSwitch, pinTrailing: false) } let actionLabel = Label() @@ -345,8 +345,8 @@ public class BaseViewController: UIViewController, Initable , } @discardableResult - open func addFormRow(label: String, tooltip: Tooltip.TooltipModel? = nil, view: UIView) -> UIView { - return formStackView.addFormRow(label: label,tooltip: tooltip, view: view) + open func addFormRow(label: String, tooltip: Tooltip.TooltipModel? = nil, view: UIView, pinTrailing: Bool = true) -> UIView { + return formStackView.addFormRow(label: label,tooltip: tooltip, view: view, pinTrailing: pinTrailing) } var activeTextField: UITextField? diff --git a/VDSSample/ViewControllers/BreadcrumbsViewController.swift b/VDSSample/ViewControllers/BreadcrumbsViewController.swift index 7c24fe8..e38dbd7 100644 --- a/VDSSample/ViewControllers/BreadcrumbsViewController.swift +++ b/VDSSample/ViewControllers/BreadcrumbsViewController.swift @@ -48,8 +48,8 @@ class BreadcrumbsViewController: BaseViewController { override func setupForm(){ super.setupForm() addFormRow(label: "Surface", view: surfacePickerSelectorView) - addFormRow(label: "Last Crumb Selected", view: selectedSwitch) - addFormRow(label: "No Long Breadcrumbs", view: sampleSwitch) + addFormRow(label: "Last Crumb Selected", view: selectedSwitch, pinTrailing: false) + addFormRow(label: "No Long Breadcrumbs", view: sampleSwitch, pinTrailing: false) selectedSwitch.onChange = { [weak self] sender in guard let self else { return } diff --git a/VDSSample/ViewControllers/ButtonGroupViewController.swift b/VDSSample/ViewControllers/ButtonGroupViewController.swift index ce11410..f4a4ff8 100644 --- a/VDSSample/ViewControllers/ButtonGroupViewController.swift +++ b/VDSSample/ViewControllers/ButtonGroupViewController.swift @@ -111,7 +111,7 @@ class ButtonGroupViewController: BaseViewController { super.setupForm() addActionRow() addFormRow(label: "Surface", view: surfacePickerSelectorView) - addFormRow(label: "Disabled", view: disabledSwitch) + addFormRow(label: "Disabled", view: disabledSwitch, pinTrailing: false) addFormRow(label: "Alignment", view: buttonAlignmentSelectorView) addFormRow(label: "Width", view: widthTextField) addFormRow(label: "Row Quantity", view: rowQuantitySelectorView) diff --git a/VDSSample/ViewControllers/ButtonIconViewController.swift b/VDSSample/ViewControllers/ButtonIconViewController.swift index b037294..d2d42a0 100644 --- a/VDSSample/ViewControllers/ButtonIconViewController.swift +++ b/VDSSample/ViewControllers/ButtonIconViewController.swift @@ -106,24 +106,24 @@ class ButtonIconViewController: BaseViewController { override func setupForm(){ super.setupForm() - addFormRow(label: "Disabled", view: disabledSwitch) + addFormRow(label: "Disabled", view: disabledSwitch, pinTrailing: false) addFormRow(label: "Surface", view: surfacePickerSelectorView) addFormRow(label: "Surface Type", view: surfaceTypePickerSelectorView) addFormRow(label: "Size", view: sizePickerSelectorView) addFormRow(label: "Kind", view: kindPickerSelectorView) addFormRow(label: "Selected Light", view: lightColorPicker) addFormRow(label: "Selected Dark", view: darkColorPicker) - addFormRow(label: "Floating", view: floating) - addFormRow(label: "Hide Border", view: hideBorder) - addFormRow(label: "Fit To Icon", view: fitToIcon) + addFormRow(label: "Floating", view: floating, pinTrailing: false) + addFormRow(label: "Hide Border", view: hideBorder, pinTrailing: false) + addFormRow(label: "Fit To Icon", view: fitToIcon, pinTrailing: false) addFormRow(label: "Name", view: namePickerSelectorView) addFormRow(label: "Selected Icon Name", view: selectedIconNamePickerSelectorView) - addFormRow(label: "Selectable", view: selectableSwitch) + addFormRow(label: "Selectable", view: selectableSwitch, pinTrailing: false) addFormRow(label: "X Offset", view: centerX) addFormRow(label: "Y Offset", view: centerY) //badgeIndicator section - addFormRow(label: "Show Badge Indicator", view: badgeIndicatorSwitch) + addFormRow(label: "Show Badge Indicator", view: badgeIndicatorSwitch, pinTrailing: false) badgeIndicatorFormStackView.addFormRow(label: "Expand Direction", view: badgeIndicatorExpandDirectionPickerSelectorView) badgeIndicatorFormStackView.addFormRow(label: "Badge Variants", view: variantOneSwitch) badgeIndicatorFormStackView.addFormRow(label: "Custom X offset", view: customBadgeIndicatorXField) diff --git a/VDSSample/ViewControllers/ButtonViewController.swift b/VDSSample/ViewControllers/ButtonViewController.swift index 8938a84..371ec2a 100644 --- a/VDSSample/ViewControllers/ButtonViewController.swift +++ b/VDSSample/ViewControllers/ButtonViewController.swift @@ -43,7 +43,7 @@ class ButtonViewController: BaseViewController