File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,18 +86,20 @@ struct UXCodeTextViewRepresentable : UXViewRepresentable {
8686 self . parent = parent
8787 }
8888
89- public func textDidChange( _ notification: Notification ) {
90- guard let textView = notification. object as? UXTextView else {
91- assertionFailure ( " unexpected notification object " )
92- return
89+ #if os(macOS)
90+ public func textDidChange( _ notification: Notification ) {
91+ guard let textView = notification. object as? UXTextView else {
92+ assertionFailure ( " unexpected notification object " )
93+ return
94+ }
95+ parent. source. wrappedValue = textView. string
96+ }
97+ #elseif os(iOS)
98+ public func textViewDidChange( _ textView: UITextView ) {
99+ parnt. source. wrappedValue = textView. string
93100 }
94- parent. source. wrappedValue = textView. string
95- }
96-
97- #if os(iOS)
98- public func textViewDidChange( _ textView: UITextView ) {
99- parent. source. wrappedValue = textView. string
100- }
101+ #else
102+ #error("Unsupported OS")
101103 #endif
102104
103105 var allowCopy : Bool {
You can’t perform that action at this time.
0 commit comments