Skip to content

Commit

Permalink
1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantannar4 committed Sep 10, 2024
1 parent 391d0da commit 6d7ba80
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
29 changes: 24 additions & 5 deletions Sources/Engine/Sources/HostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ open class HostingView<
}
}

public var disablesSafeArea: Bool = false
public var disablesSafeArea: Bool = false {
didSet {
guard oldValue != disablesSafeArea else { return }
#if os(iOS) || os(tvOS)
setNeedsLayout()
#elseif os(macOS)
needsLayout = true
#endif
}
}

#if os(iOS) || os(tvOS)
@available(iOS 16.0, tvOS 16.0, *)
Expand Down Expand Up @@ -131,11 +140,21 @@ open class HostingView<
return result
}
#else
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
guard let result = super.hitTest(point, with: event), result != self else {
return nil
private var hitTestTimestamp: TimeInterval = 0
open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let result = super.hitTest(point, with: event)
if #available(iOS 18.0, tvOS 18.0, visionOS 2.0, *) {
defer { hitTestTimestamp = event?.timestamp ?? 0 }
if result == self, event?.timestamp != hitTestTimestamp {
return nil
}
return result
} else {
if result == self {
return nil
}
return result
}
return result
}
#endif
}
Expand Down
15 changes: 10 additions & 5 deletions Sources/Engine/Sources/ViewInputs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ public struct ViewInputs {
public var _graphInputs: _GraphInputs

public var options: Options {
do {
let rawValue = try swift_getFieldValue("options", UInt32.self, _graphInputs)
return Options(rawValue: rawValue)
} catch {
return Options(rawValue: 0)
get {
do {
let rawValue = try swift_getFieldValue("options", UInt32.self, _graphInputs)
return Options(rawValue: rawValue)
} catch {
return Options(rawValue: 0)
}
}
set {
try? swift_setFieldValue("options", newValue.rawValue, &_graphInputs)
}
}

Expand Down

0 comments on commit 6d7ba80

Please sign in to comment.