Files
omnivore/apple/OmnivoreKit/Sources/Utils/CrossOSHelpers.swift
2022-06-29 20:08:42 -07:00

27 lines
839 B
Swift

import SwiftUI
#if os(iOS)
import UIKit
public typealias PlatformViewController = UIViewController
public typealias PlatformViewRepresentable = UIViewRepresentable
public typealias PlatformHostingController = UIHostingController
let osVersion = UIDevice.current.systemVersion
public let userAgent = "ios-\(osVersion)"
#elseif os(macOS)
import AppKit
public typealias PlatformViewController = NSViewController
public typealias PlatformHostingController = NSHostingController
public typealias PlatformViewRepresentable = NSViewRepresentable
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
public let userAgent = "macos-\(osVersion)"
extension NSTextView {
override open var frame: CGRect {
didSet {
backgroundColor = .clear
drawsBackground = true
}
}
}
#endif