mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
Run swift-format
This commit is contained in:
committed by
GitHub Actions
parent
921272e329
commit
d992e4c775
@@ -268,15 +268,19 @@ extension TextState {
|
|||||||
return `self`
|
return `self`
|
||||||
}
|
}
|
||||||
|
|
||||||
public func accessibilityLabel<S:StringProtocol>(_ string: S) -> Self {
|
public func accessibilityLabel<S: StringProtocol>(_ string: S) -> Self {
|
||||||
var `self` = self
|
var `self` = self
|
||||||
`self`.modifiers.append(.accessibilityLabel(.init(string)))
|
`self`.modifiers.append(.accessibilityLabel(.init(string)))
|
||||||
return `self`
|
return `self`
|
||||||
}
|
}
|
||||||
|
|
||||||
public func accessibilityLabel(_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle? = nil, comment: StaticString? = nil) -> Self {
|
public func accessibilityLabel(
|
||||||
|
_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle? = nil,
|
||||||
|
comment: StaticString? = nil
|
||||||
|
) -> Self {
|
||||||
var `self` = self
|
var `self` = self
|
||||||
`self`.modifiers.append(.accessibilityLabel(.init(key, tableName: tableName, bundle: bundle, comment: comment)))
|
`self`.modifiers.append(
|
||||||
|
.accessibilityLabel(.init(key, tableName: tableName, bundle: bundle, comment: comment)))
|
||||||
return `self`
|
return `self`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,37 +305,38 @@ extension Text {
|
|||||||
self = state.modifiers.reduce(text) { text, modifier in
|
self = state.modifiers.reduce(text) { text, modifier in
|
||||||
switch modifier {
|
switch modifier {
|
||||||
#if compiler(>=5.5.1)
|
#if compiler(>=5.5.1)
|
||||||
case let .accessibilityHeading(level):
|
case let .accessibilityHeading(level):
|
||||||
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
||||||
return text.accessibilityHeading(level.toSwiftUI)
|
return text.accessibilityHeading(level.toSwiftUI)
|
||||||
} else {
|
} else {
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
case let .accessibilityLabel(value):
|
case let .accessibilityLabel(value):
|
||||||
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
||||||
switch value.storage {
|
switch value.storage {
|
||||||
case let .verbatim(string):
|
case let .verbatim(string):
|
||||||
return text.accessibilityLabel(string)
|
return text.accessibilityLabel(string)
|
||||||
case let .localized(key, tableName, bundle, comment):
|
case let .localized(key, tableName, bundle, comment):
|
||||||
return text.accessibilityLabel(Text(key, tableName: tableName, bundle: bundle, comment: comment))
|
return text.accessibilityLabel(
|
||||||
case .concatenated(_, _):
|
Text(key, tableName: tableName, bundle: bundle, comment: comment))
|
||||||
assertionFailure("`.accessibilityLabel` does not support contcatenated `TextState`")
|
case .concatenated(_, _):
|
||||||
|
assertionFailure("`.accessibilityLabel` does not support contcatenated `TextState`")
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
case let .accessibilityTextContentType(type):
|
||||||
|
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
||||||
|
return text.accessibilityTextContentType(type.toSwiftUI)
|
||||||
|
} else {
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
case let .accessibilityTextContentType(type):
|
|
||||||
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) {
|
|
||||||
return text.accessibilityTextContentType(type.toSwiftUI)
|
|
||||||
} else {
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
case .accessibilityHeading,
|
case .accessibilityHeading,
|
||||||
.accessibilityLabel,
|
.accessibilityLabel,
|
||||||
.accessibilityTextContentType:
|
.accessibilityTextContentType:
|
||||||
return text
|
return text
|
||||||
#endif
|
#endif
|
||||||
case let .baselineOffset(baselineOffset):
|
case let .baselineOffset(baselineOffset):
|
||||||
return text.baselineOffset(baselineOffset)
|
return text.baselineOffset(baselineOffset)
|
||||||
|
|||||||
Reference in New Issue
Block a user