Skip to content

Commit

Permalink
Add ViewRespondersKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Dec 15, 2024
1 parent 23542c4 commit 3e18bc6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/OpenSwiftUICore/Data/Projection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public protocol Projection: Hashable {
func set(base: inout Base, newValue: Projected)
}

@_spi(ForSwiftUIOnly)
@_spi(ForOpenSwiftUIOnly)
extension Projection {
package func composed<Tail>(with tail: Tail) -> ComposedProjection<Self, Tail> where Tail: Projection, Projected == Tail.Base {
ComposedProjection(left: self, right: tail)
Expand Down
3 changes: 2 additions & 1 deletion Sources/OpenSwiftUICore/Extension/CGPoint+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

public import Foundation

@_spi(ForOpenSwiftUIOnly) public typealias PlatformPoint = CGPoint
@_spi(ForOpenSwiftUIOnly)
public typealias PlatformPoint = CGPoint

extension CGPoint {
@inlinable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
22 changes: 22 additions & 0 deletions Sources/OpenSwiftUICore/View/Responder/ViewRespondersKey.swift
Original file line number Diff line number Diff line change
@@ -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*/ {
}

0 comments on commit 3e18bc6

Please sign in to comment.