diff --git a/Sources/OpenSwiftUICore/Data/Projection.swift b/Sources/OpenSwiftUICore/Data/Projection.swift index 37357f5f..96247c75 100644 --- a/Sources/OpenSwiftUICore/Data/Projection.swift +++ b/Sources/OpenSwiftUICore/Data/Projection.swift @@ -13,7 +13,7 @@ public protocol Projection: Hashable { func set(base: inout Base, newValue: Projected) } -@_spi(ForSwiftUIOnly) +@_spi(ForOpenSwiftUIOnly) extension Projection { package func composed(with tail: Tail) -> ComposedProjection where Tail: Projection, Projected == Tail.Base { ComposedProjection(left: self, right: tail) diff --git a/Sources/OpenSwiftUICore/Extension/CGPoint+Extension.swift b/Sources/OpenSwiftUICore/Extension/CGPoint+Extension.swift index 92ff4fee..d26a6c77 100644 --- a/Sources/OpenSwiftUICore/Extension/CGPoint+Extension.swift +++ b/Sources/OpenSwiftUICore/Extension/CGPoint+Extension.swift @@ -7,7 +7,8 @@ public import Foundation -@_spi(ForOpenSwiftUIOnly) public typealias PlatformPoint = CGPoint +@_spi(ForOpenSwiftUIOnly) +public typealias PlatformPoint = CGPoint extension CGPoint { @inlinable diff --git a/Sources/OpenSwiftUICore/View/Graph/ViewGraph.swift b/Sources/OpenSwiftUICore/View/Graph/ViewGraph.swift index 871c8230..e3a7d199 100644 --- a/Sources/OpenSwiftUICore/View/Graph/ViewGraph.swift +++ b/Sources/OpenSwiftUICore/View/Graph/ViewGraph.swift @@ -38,7 +38,7 @@ package final class ViewGraph: GraphHost { inputs.preferences.add(DisplayList.Key.self) } if contains(.viewResponders) { - // inputs.preferences.add(ViewRespondersKey.self) + inputs.preferences.add(ViewRespondersKey.self) } } } @@ -77,7 +77,7 @@ package final class ViewGraph: GraphHost { var eventSubgraph: Subgraph? @Attribute package var defaultLayoutComputer: LayoutComputer - // @WeakAttribute var rootResponders: [ViewResponder]? + @WeakAttribute var rootResponders: [ViewResponder]? @WeakAttribute var rootLayoutComputer: LayoutComputer? @WeakAttribute var rootDisplayList: (DisplayList, DisplayList.Version)? @@ -250,7 +250,7 @@ package final class ViewGraph: GraphHost { } } if requestedOutputs.contains(.viewResponders) { - // _rootResponders = WeakAttribute(outputs.preferences[ViewRespondersKey.self]) + _rootResponders = WeakAttribute(outputs.preferences[ViewRespondersKey.self]) } if requestedOutputs.contains(.layout) { _rootLayoutComputer = WeakAttribute(outputs.layoutComputer) @@ -272,7 +272,7 @@ package final class ViewGraph: GraphHost { rootGeometry.$layoutDirection = nil } $rootLayoutComputer = nil -// $rootResponders = nil + $rootResponders = nil $rootDisplayList = nil hostPreferenceValues = WeakAttribute() #endif diff --git a/Sources/OpenSwiftUICore/EventHandling/InputEvent/HitTesting/ContentResponder.swift b/Sources/OpenSwiftUICore/View/Responder/ContentResponder.swift similarity index 91% rename from Sources/OpenSwiftUICore/EventHandling/InputEvent/HitTesting/ContentResponder.swift rename to Sources/OpenSwiftUICore/View/Responder/ContentResponder.swift index 762df482..879ddbf9 100644 --- a/Sources/OpenSwiftUICore/EventHandling/InputEvent/HitTesting/ContentResponder.swift +++ b/Sources/OpenSwiftUICore/View/Responder/ContentResponder.swift @@ -2,14 +2,14 @@ // ContentResponder.swift // OpenSwiftUI // -// Audited for iOS 15.5 +// Audited for iOS 18.0 // Status: WIP package import Foundation import OpenSwiftUI_SPI package protocol ContentResponder { - func contains(points: [CGPoint], size: CGSize) -> BitVector64 + func contains(points: [PlatformPoint], size: CGSize) -> BitVector64 func contentPath(size: CGSize) -> Path func contentPath(size: CGSize, kind: ContentShapeKinds) -> Path } diff --git a/Sources/OpenSwiftUICore/EventHandling/InputEvent/HitTesting/ContentShapeKinds.swift b/Sources/OpenSwiftUICore/View/Responder/ContentShapeKinds.swift similarity index 100% rename from Sources/OpenSwiftUICore/EventHandling/InputEvent/HitTesting/ContentShapeKinds.swift rename to Sources/OpenSwiftUICore/View/Responder/ContentShapeKinds.swift diff --git a/Sources/OpenSwiftUICore/View/Responder/ViewRespondersKey.swift b/Sources/OpenSwiftUICore/View/Responder/ViewRespondersKey.swift new file mode 100644 index 00000000..9d7e06d4 --- /dev/null +++ b/Sources/OpenSwiftUICore/View/Responder/ViewRespondersKey.swift @@ -0,0 +1,22 @@ +// +// ViewRespondersKey.swift +// OpenSwiftUICore +// +// Audited for iOS 18.0 +// Status: Empty + +package struct ViewRespondersKey: PreferenceKey { + package static var defaultValue: [ViewResponder] { [] } + + package static var _includesRemovedValues: Bool { true } + + package static func reduce(value: inout Value, nextValue: () -> Value) { + value.append(contentsOf: nextValue()) + } +} + +// TODO + +@_spi(ForOpenSwiftUIOnly) +open class ViewResponder/*: ResponderNode, CustomStringConvertible, CustomRecursiveStringConvertible*/ { +}