Skip to content

Commit

Permalink
Fix gesture test for iOS 17
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Naumov committed Sep 1, 2023
1 parent 0e4e09c commit 07c090d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/ViewInspector/Modifiers/GestureModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ public extension InspectableView {
}

func callOnLongPressGesture() throws {
if let longPress = try? modifier({ modifier -> Bool in
guard let longPress = try? Inspector
.attribute(path: "modifier|gesture|content", value: modifier),
Inspector.typeName(value: longPress) == "LongPressGesture"
else { return false }
return true
}, call: "onLongPressGesture"),
let callback = try? Inspector.attribute(
path: "modifier|gesture|modifier|callbacks|pressed|some",
value: longPress, type: ((CGPoint?) -> Void).self) {
callback(nil)
return
}
let callback = try modifierAttribute(
modifierName: "LongPressGesture",
path: "modifier|gesture|modifier|callbacks|pressed",
Expand Down

0 comments on commit 07c090d

Please sign in to comment.