Skip to content

Commit 057fe82

Browse files
committed
Fixing package specification and previews.
1 parent e6b4097 commit 057fe82

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

Package.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,19 @@ let package = Package(
99
.iOS(.v14), .macOS(.v11), .tvOS(.v14), .watchOS(.v7)
1010
],
1111
products: [
12-
// Products define the executables and libraries a package produces, and make them visible to other packages.
1312
.library(
1413
name: "XMLText",
15-
targets: ["XMLText"]),
16-
],
17-
dependencies: [
18-
// Dependencies declare other packages that this package depends on.
19-
// .package(url: /* package url */, from: "1.0.0"),
14+
targets: ["XMLText"]
15+
),
2016
],
2117
targets: [
22-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
2418
.target(
2519
name: "XMLText",
26-
dependencies: []),
20+
path: "Sources"
21+
),
2722
.testTarget(
2823
name: "XMLTextTests",
29-
dependencies: ["XMLText"]),
24+
dependencies: ["XMLText"]
25+
),
3026
]
3127
)

Sources/XMLText/Text.XMLString.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ struct Text_XMLString_Previews: PreviewProvider {
7070

7171
let firstString = "regular <italicStyle>italic&striked</italicStyle> <boldStyle>underlined</boldStyle>"
7272
Text(
73-
xmlString: string,
73+
xmlString: firstString,
7474
styleGroup: firstStyleGroup
7575
)
7676
.previewLayout(.sizeThatFits)
7777

7878
let secondString = "regular <moreKerning>more kerning</moreKerning> <moreTracking>more tracking</moreTracking>"
7979
Text(
80-
xmlString: string,
80+
xmlString: secondString,
8181
styleGroup: secondStyleGroup
8282
)
8383
.frame(maxWidth: 100.0)
8484
.previewLayout(.sizeThatFits)
8585

8686
let thirdString = "regular <moreBaselineOffset>more baseline offset</moreBaselineOffset>"
8787
Text(
88-
xmlString: string,
88+
xmlString: thirdString,
8989
styleGroup: thirdStyleGroup
9090
)
9191
.previewLayout(.sizeThatFits)
@@ -99,7 +99,7 @@ struct Text_XMLString_Previews: PreviewProvider {
9999
}
100100

101101
let italicStyle = Style { style in
102-
style.font = .italic(.system(size: 20))()
102+
style.font = Font.italic(.system(size: 20))()
103103
style.foregroundColor = .blue
104104
}
105105

@@ -118,13 +118,13 @@ struct Text_XMLString_Previews: PreviewProvider {
118118
}
119119

120120
let italicStyle = Style { style in
121-
style.font = .italic(.system(size: 20))()
121+
style.font = Font.italic(.system(size: 20))()
122122
style.foregroundColor = .blue
123123
style.strikethroughColor = .yellow
124124
}
125125

126126
let boldStyle = Style { style in
127-
style.font = .bold(.system(size: 20))()
127+
style.font = Font.bold(.system(size: 20))()
128128
style.foregroundColor = .yellow
129129
style.underlineColor = .red
130130
}
@@ -145,13 +145,13 @@ struct Text_XMLString_Previews: PreviewProvider {
145145
}
146146

147147
let moreKerning = Style { style in
148-
style.font = .italic(.system(size: 20))()
148+
style.font = Font.italic(.system(size: 20))()
149149
style.foregroundColor = .blue
150150
style.kerning = 10.0
151151
}
152152

153153
let moreTracking = Style { style in
154-
style.font = .bold(.system(size: 20))()
154+
style.font = Font.bold(.system(size: 20))()
155155
style.foregroundColor = .yellow
156156
style.tracking = 20.0
157157
}
@@ -172,7 +172,7 @@ struct Text_XMLString_Previews: PreviewProvider {
172172
}
173173

174174
let moreBaselineOffset = Style { style in
175-
style.font = .italic(.system(size: 20))()
175+
style.font = Font.italic(.system(size: 20))()
176176
style.foregroundColor = .blue
177177
style.baselineOffset = 10.0
178178
}

0 commit comments

Comments
 (0)