swift - Connecting menu items to the first responder and multiple view controllers at the same time -
i have main view controller container view in it. i’m able create ibaction in main view controller , connect menu item action in first responder successfully. when connecting different menu item container view controllers action, menu item stays grayed out.
in main view controller:
@ibaction func outermenutest(_ sender: any) { print("outermenutest") }
in container view controller:
@ibaction func containermenutest(_ sender: any) { print("containermenutest") }
how connect menu items view controllers in container view controllers @ same time? need both menu items enabled.
the easiest way connect menu items other app delegate use first responder in storyboard. need have created ibaction
appropriate class before making connection. may need clean and/or build project force xcode index ibaction
s.
provided xcode behaving , actions in classes xcode sees potential first responder show in list of options when control drag menu item first responder
in outline on left of canvas:
first responder
proxy whole responder chain. when points system start first responder , work way responder chain until finds 1 responds specified selector. long container view in responder chain message.
wiki
Comments
Post a Comment