Skip to content

Commit f1d803f

Browse files
egorzhdancompnerd
authored andcommitted
Menus and Shortcuts: add overloads for window menu construction
This mimics the UIKit's `UIResponder` API. These overloads will be wired to the `ViewController` to actually display the menus. By default just pass the events to the next responder. The subclasses which need a custom menu will need to override these.
1 parent 3e95ce7 commit f1d803f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/SwiftWin32/Touches, Presses, and Gestures/Responder.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ open class Responder {
6060
public func touchesEstimatedPropertiesUpdated(_ touches: Set<Touch>) {
6161
}
6262

63+
// MARK - Building and Validating Commands
64+
65+
/// Asks the receiving responder to add and remove items from a menu system.
66+
open func buildMenu(with builder: MenuBuilder) {
67+
self.next?.buildMenu(with: builder)
68+
}
69+
70+
/// Asks the receiving responder to validate the command.
71+
open func validate(_ command: Command) {
72+
self.next?.validate(command)
73+
}
74+
6375
// MARK - Constants
6476

6577
/// A user info key to retrieve the animation curve that the system uses to

0 commit comments

Comments
 (0)