Skip to content

Commit

Permalink
Fix visionOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Mar 2, 2024
1 parent d81efe5 commit 284f403
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Sources/TextFormation/TextInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TextStory

#if os(macOS)
import AppKit
#elseif os(iOS) || os(tvOS)
#elseif os(iOS) || os(tvOS) || os(visionOS)
import UIKit
#endif

Expand Down Expand Up @@ -53,7 +53,7 @@ public final class TextInterfaceAdapter: TextInterface {
self.setSelection = { textView.setSelectedRange($0)}
self.storage = TextStorageAdapter(textView: textView)
}
#elseif os(iOS) || os(tvOS)
#elseif os(iOS) || os(tvOS) || os(visionOS)
@MainActor
public init(textView: UITextView) {
self.getSelection = { textView.selectedRange }
Expand All @@ -68,7 +68,7 @@ public final class TextInterfaceAdapter: TextInterface {

#if os(macOS)
view.string = string
#elseif os(iOS) || os(tvOS)
#elseif os(iOS) || os(tvOS) || os(visionOS)
view.text = string
#endif

Expand Down
2 changes: 1 addition & 1 deletion Sources/TextFormation/TextViewFilterApplier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public struct TextViewFilterApplier {
private func internalTextView(_ textView: TextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
#if os(macOS)
let length = textView.textStorage?.length ?? 0
#elseif os(iOS)
#elseif os(iOS) || os(tvOS) || os(visionOS)
let length = textView.textStorage.length
#endif

Expand Down

0 comments on commit 284f403

Please sign in to comment.