Support building for visionOS

This commit is contained in:
Shadowfacts 2024-01-26 11:10:24 -05:00
parent aa8f99bb96
commit a86fe04348
2 changed files with 5 additions and 4 deletions

View File

@ -8,6 +8,7 @@ let package = Package(
platforms: [ platforms: [
.iOS(.v13), .iOS(.v13),
.macOS(.v10_15), .macOS(.v10_15),
.visionOS(.v1),
], ],
products: [ products: [
// Products define the executables and libraries a package produces, making them visible to other packages. // Products define the executables and libraries a package produces, making them visible to other packages.

View File

@ -5,13 +5,13 @@
// Created by Shadowfacts on 11/24/23. // Created by Shadowfacts on 11/24/23.
// //
#if os(iOS) #if os(iOS) || os(visionOS)
import UIKit import UIKit
#elseif os(macOS) #elseif os(macOS)
import AppKit import AppKit
#endif #endif
#if os(iOS) #if os(iOS) || os(visionOS)
private typealias PlatformFont = UIFont private typealias PlatformFont = UIFont
#elseif os(macOS) #elseif os(macOS)
private typealias PlatformFont = NSFont private typealias PlatformFont = NSFont
@ -351,7 +351,7 @@ public struct AttributedStringConverter<Callbacks: HTMLConversionCallbacks> {
} }
public struct AttributedStringConverterConfiguration { public struct AttributedStringConverterConfiguration {
#if os(iOS) #if os(iOS) || os(visionOS)
public var font: UIFont public var font: UIFont
public var monospaceFont: UIFont public var monospaceFont: UIFont
public var color: UIColor public var color: UIColor
@ -362,7 +362,7 @@ public struct AttributedStringConverterConfiguration {
#endif #endif
public var paragraphStyle: NSParagraphStyle public var paragraphStyle: NSParagraphStyle
#if os(iOS) #if os(iOS) || os(visionOS)
public init(font: UIFont, monospaceFont: UIFont, color: UIColor, paragraphStyle: NSParagraphStyle) { public init(font: UIFont, monospaceFont: UIFont, color: UIColor, paragraphStyle: NSParagraphStyle) {
self.font = font self.font = font
self.monospaceFont = monospaceFont self.monospaceFont = monospaceFont