mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Allow swipe down to open controls settings on tvOS
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user