Skip to content

Commit

Permalink
Catalyst, better guards
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Jan 22, 2024
1 parent f02e6b2 commit a93eae9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- "platform=tvOS Simulator,name=Apple TV"
- "platform=visionOS Simulator,name=Apple Vision Pro"
- "platform=watchOS Simulator,name=Apple Watch Series 6 (40mm)"
- "platform=macOS,variant=Mac Catalyst"

steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions Sources/Rearrange/NSTextLocation+Comparable.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#if canImport(AppKit)
#if os(macOS) && !targetEnvironment(macCatalyst)
import AppKit
#elseif canImport(UIKit)
import UIKit
#endif

#if os(iOS) || os(tvOS) || os(macOS) || os(visionOS)
#if (os(macOS) && !targetEnvironment(macCatalyst)) || canImport(UIKit)

@available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
extension NSTextLocation {

Check failure on line 10 in Sources/Rearrange/NSTextLocation+Comparable.swift

View workflow job for this annotation

GitHub Actions / Test (platform=watchOS Simulator,name=Apple Watch Series 6 (40mm))

cannot find type 'NSTextLocation' in scope

Check failure on line 10 in Sources/Rearrange/NSTextLocation+Comparable.swift

View workflow job for this annotation

GitHub Actions / Test (platform=watchOS Simulator,name=Apple Watch Series 6 (40mm))

cannot find type 'NSTextLocation' in scope
Expand Down
6 changes: 3 additions & 3 deletions Sources/Rearrange/NSTextRange+NSRange.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#if canImport(AppKit)
#if os(macOS) && !targetEnvironment(macCatalyst)
import AppKit
#elseif canImport(UIKit)
#elseif os(iOS) || os(tvOS) || os(visionOS)
import UIKit
#endif

#if os(iOS) || os(tvOS) || os(macOS) || os(visionOS)
#if os(macOS) || os(iOS) || os(tvOS) || 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if canImport(UIKit)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit

public extension NSRange {
Expand Down
4 changes: 2 additions & 2 deletions Tests/RearrangeTests/NSTextRangeTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
#if canImport(AppKit)
#if os(macOS) && !targetEnvironment(macCatalyst)
import AppKit
#elseif canImport(UIKit)
#elseif os(iOS) || os(tvOS) || os(visionOS)
import UIKit
#endif

Expand Down
2 changes: 1 addition & 1 deletion Tests/RearrangeTests/UITextRangeTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Rearrange
#if canImport(UIKit)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit

final class UITextRangeTests: XCTestCase {
Expand Down

0 comments on commit a93eae9

Please sign in to comment.