Skip to content

Commit

Permalink
Trying visionOS compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Jan 22, 2024
1 parent 3b154b5 commit f02e6b2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -13,25 +13,27 @@ on:
branches:
- main

env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer

jobs:
test:
name: Test
runs-on: macOS-latest
runs-on: macos-13
strategy:
matrix:
destination:
- "platform=macOS"
- "platform=iOS Simulator,name=iPhone 12"
- "platform=iOS Simulator,name=iPhone 15"
- "platform=tvOS Simulator,name=Apple TV"
- "platform=visionOS Simulator,name=Apple Vision Pro"
- "platform=watchOS Simulator,name=Apple Watch Series 6 (40mm)"

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install XCBeautify
run: brew install xcbeautify
- name: Test platform ${{ matrix.destination }}
run: set -o pipefail && xcodebuild -scheme Rearrange -destination "${{ matrix.destination }}" test | xcbeautify --renderer github-actions
run: set -o pipefail && xcodebuild -scheme Rearrange -destination "${{ matrix.destination }}" test | xcbeautify

linux_test:
name: Test Linux
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rearrange/NSTextLocation+Comparable.swift
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

#if os(iOS) || os(tvOS) || os(macOS)
#if os(iOS) || os(tvOS) || os(macOS) || os(visionOS)

@available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
extension NSTextLocation {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rearrange/NSTextRange+NSRange.swift
Expand Up @@ -4,7 +4,7 @@ import AppKit
import UIKit
#endif

#if os(iOS) || os(tvOS) || os(macOS)
#if os(iOS) || os(tvOS) || os(macOS) || os(visionOS)

@available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
public extension NSRange {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Rearrange/UITextRange+Convenience.swift
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS)
#if canImport(UIKit)
import UIKit

public extension NSRange {
Expand Down
6 changes: 3 additions & 3 deletions Tests/RearrangeTests/NSTextRangeTests.swift
@@ -1,11 +1,11 @@
import XCTest
#if os(macOS)
#if canImport(AppKit)
import AppKit
#elseif os(iOS) || os(tvOS)
#elseif canImport(UIKit)
import UIKit
#endif

#if os(macOS) || os(iOS) || os(tvOS)
#if os(macOS) || os(iOS) || os(tvOS) || os(visionOS)

class NSTextRangeTests: XCTestCase {
func testFullDocumentRange() throws {
Expand Down
2 changes: 1 addition & 1 deletion Tests/RearrangeTests/UITextRangeTests.swift
@@ -1,6 +1,6 @@
import XCTest
import Rearrange
#if os(iOS) || os(tvOS)
#if canImport(UIKit)
import UIKit

final class UITextRangeTests: XCTestCase {
Expand Down

0 comments on commit f02e6b2

Please sign in to comment.