Skip to content

Commit d9094ac

Browse files
committed
Fix Text init issue
1 parent 8120c7b commit d9094ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/OpenSwiftUICore/Text/Accessibility/Text+Accessibility.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ package struct AccessibilityText: Equatable {
106106
}
107107

108108
package init(_ string: Any) {
109+
#if canImport(Darwin)
109110
let object = string as AnyObject
110111
if object.isKind(of: NSAttributedString.self) {
111112
self.storage = .attributed(object as! NSAttributedString)
@@ -116,6 +117,9 @@ package struct AccessibilityText: Equatable {
116117
} else {
117118
preconditionFailure("not a string type")
118119
}
120+
#else
121+
_openSwiftUIPlatformUnimplementedFailure()
122+
#endif
119123
}
120124

121125
package var text: Text {

0 commit comments

Comments
 (0)