From 7343b670e9a631609b7f7277674bc833fcd17ed5 Mon Sep 17 00:00:00 2001 From: Vasavi Kanamarlapudi Date: Thu, 12 Sep 2024 13:24:19 +0530 Subject: [PATCH] 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 } } }