The playground, the notebook cells, the source editor with its marks, the inspector columns and the canvas are written once for both Apple platforms, with a file naming what the two frameworks call differently. The editor is where they really part company. The engine owns the image and its start-up, so a mission reaches the whole of Pharo.
24 lines
438 B
Swift
24 lines
438 B
Swift
import SwiftUI
|
|
|
|
#if canImport(AppKit)
|
|
import AppKit
|
|
|
|
typealias PlatformFont = NSFont
|
|
typealias PlatformColor = NSColor
|
|
#elseif canImport(UIKit)
|
|
import UIKit
|
|
|
|
typealias PlatformFont = UIFont
|
|
typealias PlatformColor = UIColor
|
|
#endif
|
|
|
|
extension PlatformColor {
|
|
static var platformLabel: PlatformColor {
|
|
#if canImport(AppKit)
|
|
.labelColor
|
|
#else
|
|
.label
|
|
#endif
|
|
}
|
|
}
|