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.
1 parent 323a050 commit c6e55c8Copy full SHA for c6e55c8
Sources/ScreenData/Objects/SomeView.swift
@@ -4,6 +4,8 @@ public struct SomeView: Codable {
4
public var container: SomeContainerView?
5
public var someImage: SomeImage?
6
public var someLabel: SomeLabel?
7
+ public var someText: SomeText?
8
+ public var someButton: SomeButton?
9
public var someLabeledImage: SomeLabeledImage?
10
public var someCustomView: SomeCustomView?
11
@@ -12,13 +14,17 @@ public struct SomeView: Codable {
12
14
container: SomeContainerView? = nil,
13
15
someImage: SomeImage? = nil,
16
someLabel: SomeLabel? = nil,
17
+ someText: SomeText? = nil,
18
+ someButton: SomeButton? = nil,
19
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,5 +1,7 @@
1
public enum ViewType: String, Codable {
2
case label
3
+ case text
+ case button
case image
case labeledImage
case container
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 {
public init(
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