Skip to content

Commit 9b9df11

Browse files
committed
Updates for visionOS support
1 parent c880a70 commit 9b9df11

9 files changed

+15
-13
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import PackageDescription
1313
let package = Package(
1414
name: "MotionMachine",
1515
platforms: [
16-
.iOS(.v13), .tvOS(.v13)
16+
.iOS(.v13), .tvOS(.v13), .visionOS(.v1)
1717
],
1818
products: [
1919
.library(name: "MotionMachine", targets: ["MotionMachine"])

Sources/Motion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public class Motion: Moveable, Additive, TempoDriven, PropertyDataDelegate {
556556

557557
reverseEasing = self.easing
558558

559-
#if os(iOS) || os(tvOS)
559+
#if os(iOS) || os(tvOS) || os(visionOS)
560560
if let assistant_group = valueAssistant as? ValueAssistantGroup {
561561
assistant_group.add(UIColorAssistant())
562562
assistant_group.add(CIColorAssistant())

Sources/MotionSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ import UIKit
227227
/// Represents a `CATransform3D` type.
228228
case transform3D
229229

230-
#if os(iOS) || os(tvOS)
230+
#if os(iOS) || os(tvOS) || os(visionOS)
231231
/// Represents a `UIEdgeInsets` type.
232232
case uiEdgeInsets
233233

Sources/PathMotion.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,6 @@ public class PathMotion: Moveable, TempoDriven, PropertyDataDelegate {
484484
}
485485
reverseEasing = self.easing
486486

487-
#if os(iOS) || os(tvOS)
488-
if let assistant_group = valueAssistant as? ValueAssistantGroup {
489-
assistant_group.add(UIColorAssistant())
490-
assistant_group.add(CIColorAssistant())
491-
assistant_group.add(UIKitStructAssistant())
492-
}
493-
#endif
494-
495487
// unpack options values
496488
if let options {
497489
repeating = options.contains(.repeats)

Sources/PhysicsMotion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public typealias PhysicsMotionCompleted = PhysicsMotionUpdateClosure
579579

580580
self.targetObject = targetObject
581581

582-
#if os(iOS) || os(tvOS)
582+
#if os(iOS) || os(tvOS) || os(visionOS)
583583
if let assistant_group = valueAssistant as? ValueAssistantGroup {
584584
assistant_group.add(UIColorAssistant())
585585
assistant_group.add(CIColorAssistant())

Sources/ValueAssistants/CGStructAssistant.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111
import CoreGraphics
1212
import QuartzCore
1313

14-
#if os(iOS) || os(tvOS)
14+
#if canImport(UIKit)
1515
import UIKit
1616
#endif
1717

Sources/ValueAssistants/CIColorAssistant.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
// Licensed under MIT License. See LICENSE file in this repository.
99

1010
import Foundation
11+
#if canImport(CoreImage)
1112
import CoreImage
13+
#endif
1214

15+
#if os(iOS) || os(tvOS) || os(visionOS)
1316
/// CIColorAssistant provides support for Core Image's `CIColor` type.
1417
public final class CIColorAssistant : ValueAssistant {
1518

@@ -266,3 +269,4 @@ public final class CIColorAssistant : ValueAssistant {
266269

267270

268271
}
272+
#endif

Sources/ValueAssistants/UIColorAssistant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// Licensed under MIT License. See LICENSE file in this repository.
99

1010
import Foundation
11+
#if canImport(UIKit)
1112
import UIKit
13+
#endif
1214

1315
/// UIColorAssistant provides support for the `UIColor` type.
1416
public final class UIColorAssistant : ValueAssistant {

Sources/ValueAssistants/UIKitStructAssistant.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
// Licensed under MIT License. See LICENSE file in this repository.
99

1010
import Foundation
11+
#if canImport(UIKit)
1112
import UIKit
13+
#endif
1214

15+
#if os(iOS) || os(tvOS) || os(visionOS)
1316
/// UIKitStructAssistant provides support for the UIKit structs `UIEdgeInsets` and `UIOffset`.
1417
public final class UIKitStructAssistant : ValueAssistant {
1518

@@ -455,3 +458,4 @@ public final class UIKitStructAssistant : ValueAssistant {
455458

456459
}
457460

461+
#endif

0 commit comments

Comments
 (0)