Skip to content

Commit 9f6c50f

Browse files
gonzalezrealgithub-actions[bot]
authored andcommitted
Run swift format
1 parent ba61e69 commit 9f6c50f

File tree

3 files changed

+49
-70
lines changed

3 files changed

+49
-70
lines changed

Examples/Demo/Demo/CodeSyntaxHighlightView.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ struct CodeSyntaxHighlightView: View {
147147
}
148148

149149
private func copyToClipboard(_ string: String) {
150-
#if os(macOS)
151-
if let pasteboard = NSPasteboard.general {
152-
pasteboard.clearContents()
153-
pasteboard.setString(string, forType: .string)
154-
}
155-
#elseif os(iOS)
156-
UIPasteboard.general.string = string
157-
#endif
150+
#if os(macOS)
151+
if let pasteboard = NSPasteboard.general {
152+
pasteboard.clearContents()
153+
pasteboard.setString(string, forType: .string)
154+
}
155+
#elseif os(iOS)
156+
UIPasteboard.general.string = string
157+
#endif
158158
}
159159
}
160160

Sources/MarkdownUI/Utility/Deprecations.swift

+27-46
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ extension View {
4646
@available(
4747
*,
4848
deprecated,
49-
message:
50-
"""
49+
message: """
5150
Use the version of this function that takes a closure receiving a generic 'Configuration'
5251
value.
5352
"""
@@ -62,8 +61,7 @@ extension View {
6261
@available(
6362
*,
6463
deprecated,
65-
message:
66-
"""
64+
message: """
6765
Use the version of this function that takes a closure receiving a generic 'Configuration'
6866
value.
6967
"""
@@ -85,8 +83,7 @@ extension Theme {
8583
@available(
8684
*,
8785
deprecated,
88-
message:
89-
"""
86+
message: """
9087
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
9188
value.
9289
"""
@@ -102,8 +99,7 @@ extension Theme {
10299
@available(
103100
*,
104101
deprecated,
105-
message:
106-
"""
102+
message: """
107103
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
108104
value.
109105
"""
@@ -119,8 +115,7 @@ extension Theme {
119115
@available(
120116
*,
121117
deprecated,
122-
message:
123-
"""
118+
message: """
124119
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
125120
value.
126121
"""
@@ -136,8 +131,7 @@ extension Theme {
136131
@available(
137132
*,
138133
deprecated,
139-
message:
140-
"""
134+
message: """
141135
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
142136
value.
143137
"""
@@ -153,8 +147,7 @@ extension Theme {
153147
@available(
154148
*,
155149
deprecated,
156-
message:
157-
"""
150+
message: """
158151
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
159152
value.
160153
"""
@@ -170,8 +163,7 @@ extension Theme {
170163
@available(
171164
*,
172165
deprecated,
173-
message:
174-
"""
166+
message: """
175167
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
176168
value.
177169
"""
@@ -187,8 +179,7 @@ extension Theme {
187179
@available(
188180
*,
189181
deprecated,
190-
message:
191-
"""
182+
message: """
192183
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
193184
value.
194185
"""
@@ -204,8 +195,7 @@ extension Theme {
204195
@available(
205196
*,
206197
deprecated,
207-
message:
208-
"""
198+
message: """
209199
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
210200
value.
211201
"""
@@ -221,8 +211,7 @@ extension Theme {
221211
@available(
222212
*,
223213
deprecated,
224-
message:
225-
"""
214+
message: """
226215
Use the version of this function that takes a closure receiving a 'CodeBlockConfiguration'
227216
value.
228217
"""
@@ -240,8 +229,7 @@ extension Theme {
240229
@available(
241230
*,
242231
deprecated,
243-
message:
244-
"""
232+
message: """
245233
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
246234
value.
247235
"""
@@ -257,8 +245,7 @@ extension Theme {
257245
@available(
258246
*,
259247
deprecated,
260-
message:
261-
"""
248+
message: """
262249
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
263250
value.
264251
"""
@@ -274,8 +261,7 @@ extension Theme {
274261
@available(
275262
*,
276263
deprecated,
277-
message:
278-
"""
264+
message: """
279265
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
280266
value.
281267
"""
@@ -291,8 +277,7 @@ extension Theme {
291277
@available(
292278
*,
293279
deprecated,
294-
message:
295-
"""
280+
message: """
296281
Use the version of this function that takes a closure receiving a 'BlockConfiguration'
297282
value.
298283
"""
@@ -330,11 +315,10 @@ public typealias InlineCode = Code
330315
@available(
331316
*,
332317
unavailable,
333-
message:
318+
message: """
319+
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
320+
types "DefaultImageProvider" and "AssetImageProvider".
334321
"""
335-
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
336-
types "DefaultImageProvider" and "AssetImageProvider".
337-
"""
338322
)
339323
public struct MarkdownImageHandler {
340324
public static var networkImage: Self {
@@ -353,11 +337,10 @@ extension Markdown {
353337
@available(
354338
*,
355339
unavailable,
356-
message:
340+
message: """
341+
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
342+
types "DefaultImageProvider" and "AssetImageProvider".
357343
"""
358-
"MarkdownImageHandler" has been superseded by the "ImageProvider" protocol and its conforming
359-
types "DefaultImageProvider" and "AssetImageProvider".
360-
"""
361344
)
362345
public func setImageHandler(
363346
_ imageHandler: MarkdownImageHandler,
@@ -381,11 +364,10 @@ extension View {
381364
@available(
382365
*,
383366
unavailable,
384-
message:
367+
message: """
368+
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
369+
"BlockStyle" types.
385370
"""
386-
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
387-
"BlockStyle" types.
388-
"""
389371
)
390372
public struct MarkdownStyle: Hashable {
391373
public struct Font: Hashable {
@@ -501,11 +483,10 @@ extension View {
501483
@available(
502484
*,
503485
unavailable,
504-
message:
486+
message: """
487+
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
488+
"BlockStyle" types.
505489
"""
506-
"MarkdownStyle" and its subtypes have been superseded by the "Theme", "TextStyle", and
507-
"BlockStyle" types.
508-
"""
509490
)
510491
public func markdownStyle(_ markdownStyle: MarkdownStyle) -> some View {
511492
self

Sources/MarkdownUI/Views/Blocks/ListItemView.swift

+14-16
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,27 @@ struct ListItemView: View {
4141
.frame(width: self.markerWidth, alignment: .trailing)
4242
}
4343
#if os(visionOS)
44-
.labelStyle(BulletItemStyle())
44+
.labelStyle(BulletItemStyle())
4545
#endif
4646
}
4747
}
4848

49-
5049
extension VerticalAlignment {
51-
private enum CenterOfFirstLine: AlignmentID {
52-
static func defaultValue(in context: ViewDimensions) -> CGFloat {
53-
let heightAfterFirstLine = context[.lastTextBaseline] - context[.firstTextBaseline]
54-
let heightOfFirstLine = context.height - heightAfterFirstLine
55-
return heightOfFirstLine / 2
56-
}
57-
}
58-
static let centerOfFirstLine = Self(CenterOfFirstLine.self)
50+
private enum CenterOfFirstLine: AlignmentID {
51+
static func defaultValue(in context: ViewDimensions) -> CGFloat {
52+
let heightAfterFirstLine = context[.lastTextBaseline] - context[.firstTextBaseline]
53+
let heightOfFirstLine = context.height - heightAfterFirstLine
54+
return heightOfFirstLine / 2
55+
}
56+
}
57+
static let centerOfFirstLine = Self(CenterOfFirstLine.self)
5958
}
6059

61-
6260
struct BulletItemStyle: LabelStyle {
63-
func makeBody(configuration: Configuration) -> some View {
64-
HStack(alignment: .centerOfFirstLine, spacing: 4) {
65-
configuration.icon
66-
configuration.title
67-
}
61+
func makeBody(configuration: Configuration) -> some View {
62+
HStack(alignment: .centerOfFirstLine, spacing: 4) {
63+
configuration.icon
64+
configuration.title
6865
}
66+
}
6967
}

0 commit comments

Comments
 (0)