Skip to content

Commit 07c090d

Browse files
author
Alexey Naumov
committed
Fix gesture test for iOS 17
1 parent 0e4e09c commit 07c090d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Sources/ViewInspector/Modifiers/GestureModifiers.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ public extension InspectableView {
1414
}
1515

1616
func callOnLongPressGesture() throws {
17+
if let longPress = try? modifier({ modifier -> Bool in
18+
guard let longPress = try? Inspector
19+
.attribute(path: "modifier|gesture|content", value: modifier),
20+
Inspector.typeName(value: longPress) == "LongPressGesture"
21+
else { return false }
22+
return true
23+
}, call: "onLongPressGesture"),
24+
let callback = try? Inspector.attribute(
25+
path: "modifier|gesture|modifier|callbacks|pressed|some",
26+
value: longPress, type: ((CGPoint?) -> Void).self) {
27+
callback(nil)
28+
return
29+
}
1730
let callback = try modifierAttribute(
1831
modifierName: "LongPressGesture",
1932
path: "modifier|gesture|modifier|callbacks|pressed",

0 commit comments

Comments
 (0)