Seems like all the backgroundColor:NSColor variables can be replaced with SwiftUI.Color and then at the end a cross platform alias
#if os(macOS)
import AppKit
typealias UXTextView = NSTextView
typealias UXTextViewDelegate = NSTextViewDelegate
typealias UColor = NSColor
#else
import UIKit
typealias UXTextView = UITextView
typealias UXTextViewDelegate = UITextViewDelegate
typealias UColor = UIColor
#endif
Seems like all the
backgroundColor:NSColorvariables can be replaced withSwiftUI.Colorand then at the end a cross platform alias