Skip to content

Commit 1a86c6c

Browse files
authored
Merge pull request #12 from ServerDriven/develop
0.3.0
2 parents 1aba08d + e3b1373 commit 1a86c6c

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public enum FontType: String, Codable {
2+
case largeTitle
3+
case title
4+
case headline
5+
case body
6+
case footnote
7+
case caption
8+
}

Sources/ScreenData/Views/SomeLabel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public struct SomeLabel: Codable, Hashable {
44
public var title: String
55
public var subtitle: String?
66

7+
public var font: FontType
78
public var style: SomeStyle?
89

910
public var destination: Destination?
@@ -16,12 +17,14 @@ public struct SomeLabel: Codable, Hashable {
1617
id: String? = nil,
1718
title: String,
1819
subtitle: String? = nil,
20+
font: FontType,
1921
style: SomeStyle? = nil,
2022
destination: Destination? = nil
2123
) {
2224
self.id = id
2325
self.title = title
2426
self.subtitle = subtitle
27+
self.font = font
2528
self.style = style
2629
self.destination = destination
2730
}

Sources/ScreenData/Views/SomeLabeledImage.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ public struct SomeLabeledImage: Codable, Hashable {
55
public var subtitle: String?
66
public var someImage: SomeImage
77

8+
public var font: FontType
89
public var style: SomeStyle?
910

1011
public var destination: Destination?
@@ -18,13 +19,15 @@ public struct SomeLabeledImage: Codable, Hashable {
1819
title: String,
1920
subtitle: String? = nil,
2021
someImage: SomeImage,
22+
font: FontType,
2123
style: SomeStyle? = nil,
2224
destination: Destination? = nil
2325
) {
2426
self.id = id
2527
self.title = title
2628
self.subtitle = subtitle
2729
self.someImage = someImage
30+
self.font = font
2831
self.style = style
2932
self.destination = destination
3033
}

Tests/ScreenDataTests/ScreenDataTests.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ final class ScreenDataTests: XCTestCase {
66
// This is an example of a functional test case.
77
// Use XCTAssert and related functions to verify your tests produce the correct
88
// results.
9-
XCTAssertEqual(SomeLabel(title: "Hello, World!",
10-
subtitle: nil,
11-
style: nil,
12-
destination: nil).title, "Hello, World!")
9+
XCTAssertEqual(
10+
SomeLabel(
11+
title: "Hello, World!",
12+
font: .title
13+
).title,
14+
"Hello, World!"
15+
)
1316
}
14-
17+
1518
static var allTests = [
1619
("testExample", testExample),
1720
]

0 commit comments

Comments
 (0)