Added support for visionOS by adding to #if os(iOS) || os(visionOS)
This commit is contained in:
@@ -8,7 +8,7 @@ import Foundation
|
||||
// MIT license. See the LICENSE file for details.
|
||||
//
|
||||
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(visionOS)
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(visionOS)
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
@@ -86,7 +86,7 @@ extension MTMathImage {
|
||||
let size = intrinsicContentSize
|
||||
layoutImage(size: size, displayList: displayList)
|
||||
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(visionOS)
|
||||
let renderer = UIGraphicsImageRenderer(size: size)
|
||||
let image = renderer.image { rendererContext in
|
||||
rendererContext.cgContext.saveGState()
|
||||
|
||||
@@ -13,7 +13,7 @@ import SwiftUI
|
||||
|
||||
func isIos6Supported() -> Bool {
|
||||
if !MTDisplay.initialized {
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(visionOS)
|
||||
let reqSysVer = "6.0"
|
||||
let currSysVer = UIDevice.current.systemVersion
|
||||
if currSysVer.compare(reqSysVer, options: .numeric) != .orderedAscending {
|
||||
@@ -58,7 +58,7 @@ public class MTDisplay:NSObject {
|
||||
}
|
||||
|
||||
/// For debugging. Shows the object in quick look in Xcode.
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(visionOS)
|
||||
func debugQuickLookObject() -> Any {
|
||||
let size = CGSizeMake(self.width, self.ascent + self.descent);
|
||||
UIGraphicsBeginImageContext(size);
|
||||
|
||||
Reference in New Issue
Block a user