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.

enter image description here

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 ibactions.

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:

enter image description here

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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -