From d2d8140b70ac113a87c90344563fd3bb63103696 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 25 Jan 2023 09:53:56 -0600 Subject: [PATCH] added codable to enums Signed-off-by: Matt Bruce --- VDS/Components/Buttons/Button/Button.swift | 2 +- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 2 +- VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift | 2 +- VDS/Components/Icon/IconColor.swift | 2 +- VDS/Components/TextFields/EntryField/EntryField.swift | 2 +- VDS/Components/TextFields/InputField/InputField.swift | 2 +- VDS/Components/TileContainer/TileContainer.swift | 6 +++--- VDS/Components/Tilelet/Tilelet.swift | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index 1bc94e2e..1a4bc3d4 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -11,7 +11,7 @@ import VDSColorTokens import VDSFormControlsTokens import Combine -public enum ButtonSize: String, Codable, CaseIterable { +public enum ButtonSize: String, CaseIterable, Codable { case large case small } diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 1bc28dba..6d3f2ef3 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -17,7 +17,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum ButtonPosition: String, CaseIterable { + public enum ButtonPosition: String, CaseIterable, Codable { case left, center, right } diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index 7c2f9fbd..184737dc 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -17,7 +17,7 @@ open class TextLinkCaret: ButtonBase { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum IconPosition: String, CaseIterable { + public enum IconPosition: String, CaseIterable, Codable { case left, right } diff --git a/VDS/Components/Icon/IconColor.swift b/VDS/Components/Icon/IconColor.swift index c9d4bf0e..10d7a174 100644 --- a/VDS/Components/Icon/IconColor.swift +++ b/VDS/Components/Icon/IconColor.swift @@ -10,7 +10,7 @@ import VDSColorTokens import UIKit extension Icon { - public enum Color: String, CaseIterable { + public enum Color: String, CaseIterable, Codable { case black case white case red diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 5e500b9a..17104e46 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -16,7 +16,7 @@ open class EntryField: Control, Accessable { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum HelperTextPlacement: String, CaseIterable { + public enum HelperTextPlacement: String, CaseIterable, Codable { case bottom, right } diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index c4c4f120..3b498043 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -16,7 +16,7 @@ public class InputField: EntryField, UITextFieldDelegate { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum FieldType: String, CaseIterable { + public enum FieldType: String, CaseIterable, Codable { case text, number, calendar, inlineAction, password, creditCard, tel, date, securityCode } diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index e8ebe3f4..efccea75 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -34,14 +34,14 @@ open class TileContainer: Control { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum BackgroundColor: String, Codable, CaseIterable { + public enum BackgroundColor: String, CaseIterable, Codable { case white case black case gray case transparent } - public enum Padding: String, Codable, CaseIterable { + public enum Padding: String, CaseIterable, Codable { case padding2X case padding4X case padding6X @@ -64,7 +64,7 @@ open class TileContainer: Control { } } - public enum AspectRatio: String, Codable, CaseIterable { + public enum AspectRatio: String, CaseIterable, Codable { case ratio1x1 = "1:1" case ratio3x4 = "3:4" case ratio4x3 = "4:3" diff --git a/VDS/Components/Tilelet/Tilelet.swift b/VDS/Components/Tilelet/Tilelet.swift index dd35a951..918d5ee7 100644 --- a/VDS/Components/Tilelet/Tilelet.swift +++ b/VDS/Components/Tilelet/Tilelet.swift @@ -15,7 +15,7 @@ open class Tilelet: TileContainer { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - public enum TextPosition: String, Codable, CaseIterable { + public enum TextPosition: String, CaseIterable, Codable { case top case bottom }