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: [
.iOS(.v13),
.macOS(.v10_15),
.visionOS(.v1),
],
products: [
// 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.
//
#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit
#elseif os(macOS)
import AppKit
#endif
#if os(iOS)
#if os(iOS) || os(visionOS)
private typealias PlatformFont = UIFont
#elseif os(macOS)
private typealias PlatformFont = NSFont
@ -351,7 +351,7 @@ public struct AttributedStringConverter<Callbacks: HTMLConversionCallbacks> {
}
public struct AttributedStringConverterConfiguration {
#if os(iOS)
#if os(iOS) || os(visionOS)
public var font: UIFont
public var monospaceFont: UIFont
public var color: UIColor
@ -362,7 +362,7 @@ public struct AttributedStringConverterConfiguration {
#endif
public var paragraphStyle: NSParagraphStyle
#if os(iOS)
#if os(iOS) || os(visionOS)
public init(font: UIFont, monospaceFont: UIFont, color: UIColor, paragraphStyle: NSParagraphStyle) {
self.font = font
self.monospaceFont = monospaceFont