Allow swipe down to open controls settings on tvOS

This commit is contained in:
Arkadiusz Fal
2022-08-15 00:14:28 +02:00
parent a776b06fc6
commit 4dd9005508
2 changed files with 13 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ struct TVControls: UIViewRepresentable {
let upSwipe = UISwipeGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handleSwipe(sender:)))
upSwipe.direction = .up
let downSwipe = UISwipeGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handleSwipe(sender:)))
let downSwipe = UISwipeGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handleSwipeDown(sender:)))
downSwipe.direction = .down
controlsArea.addGestureRecognizer(leftSwipe)
@@ -63,5 +63,9 @@ struct TVControls: UIViewRepresentable {
let location = sender.location(in: view)
model.reporter.send("swipe \(location)")
}
@objc func handleSwipeDown(sender _: UISwipeGestureRecognizer) {
model.reporter.send("swipe down")
}
}
}