We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e457a77 + 1067569 commit 2187d84Copy full SHA for 2187d84
Sources/ScreenData/Objects/SomeStyle.swift
@@ -1,12 +1,19 @@
1
public struct SomeStyle: Codable {
2
- public var backgroundColor: SomeColor?
3
public var isHidden: Bool
+ public var cornerRadius: Int
4
+
5
+ public var foregroundColor: SomeColor?
6
+ public var backgroundColor: SomeColor?
7
8
public init(
- backgroundColor: SomeColor? = nil,
- isHidden: Bool = false
9
+ isHidden: Bool = false,
10
+ cornerRadius: Int = 0,
11
+ foregroundColor: SomeColor? = nil,
12
+ backgroundColor: SomeColor? = nil
13
) {
- self.backgroundColor = backgroundColor
14
self.isHidden = isHidden
15
+ self.cornerRadius = cornerRadius
16
+ self.foregroundColor = foregroundColor
17
+ self.backgroundColor = backgroundColor
18
}
19
Sources/ScreenData/Objects/SomeView.swift
@@ -4,6 +4,8 @@ public struct SomeView: Codable {
public var container: SomeContainerView?
public var someImage: SomeImage?
public var someLabel: SomeLabel?
+ public var someText: SomeText?
+ public var someButton: SomeButton?
public var someLabeledImage: SomeLabeledImage?
public var someCustomView: SomeCustomView?
@@ -12,13 +14,17 @@ public struct SomeView: Codable {
container: SomeContainerView? = nil,
someImage: SomeImage? = nil,
someLabel: SomeLabel? = nil,
+ someText: SomeText? = nil,
+ someButton: SomeButton? = nil,
someLabeledImage: SomeLabeledImage? = nil,
20
someCustomView: SomeCustomView? = nil
21
22
self.type = type
23
self.container = container
24
self.someImage = someImage
25
self.someLabel = someLabel
26
+ self.someText = someText
27
+ self.someButton = someButton
28
self.someLabeledImage = someLabeledImage
29
self.someCustomView = someCustomView
30
Sources/ScreenData/Types/ViewType.swift
@@ -1,7 +1,9 @@
public enum ViewType: String, Codable {
- case label
- case image
- case labeledImage
- case container
+ case label
+ case text
+ case button
+ case image
+ case labeledImage
+ case container
case custom
Sources/ScreenData/Views/SomeButton.swift
@@ -0,0 +1,27 @@
+public struct SomeButton: Codable {
+ public var id: String?
+ public var title: String
+ public var actionID: String?
+ public var destination: Destination?
+ public var style: SomeStyle?
+ public var type: ViewType {
+ .button
+ }
+ public init(
+ id: String? = nil,
+ title: String,
+ actionID: String? = nil,
+ destination: Destination? = nil,
+ style: SomeStyle? = nil
+ ) {
+ self.id = id
+ self.title = title
+ self.destination = destination
+ self.style = style
+}
Sources/ScreenData/Views/SomeContainerView.swift
@@ -14,7 +14,7 @@ public struct SomeContainerView: Codable {
id: String? = nil,
axis: ViewDirectionAxis,
views: [SomeView],
- style: SomeStyle?
self.id = id
self.axis = axis
Sources/ScreenData/Views/SomeCustomView.swift
@@ -20,10 +20,10 @@ public struct SomeCustomView: Codable {
title: String,
- subtitle: String?,
- style: SomeStyle?,
- someImage: SomeImage?,
- destination: Destination?,
+ subtitle: String? = nil,
+ style: SomeStyle? = nil,
+ someImage: SomeImage? = nil,
views: [SomeView]
Sources/ScreenData/Views/SomeImage.swift
@@ -14,8 +14,8 @@ public struct SomeImage: Codable {
url: String,
- destination: Destination?
+ destination: Destination? = nil
self.url = url
Sources/ScreenData/Views/SomeLabel.swift
@@ -15,9 +15,9 @@ public struct SomeLabel: Codable {
self.title = title
Sources/ScreenData/Views/SomeLabeledImage.swift
@@ -16,10 +16,10 @@ public struct SomeLabeledImage: Codable {
someImage: SomeImage,
Sources/ScreenData/Views/SomeText.swift
@@ -0,0 +1,21 @@
+public struct SomeText: Codable {
+ .text
0 commit comments