Connect to ViewController from AppDelegate (Swift)

后端 未结 5 1217
Happy的楠姐
Happy的楠姐 2021-02-04 15:55

I have created a new OS X Cocoa Application using the standard Xcode Swift template (using StoryBoards).

I have implemented an IBAction in AppDelegate.swift to handle wh

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 16:13

    I was stuck trying to do this same thing recently and managed to get the event I needed to update my view by creating the @IBAction in my ViewController and control dragging to my Application's First Responder (above the menu in my storyboard view).

    Here's the question that got me out of the woods: Application Menu Items Xcode

    And thanks to Bluedome for the suggestion to connect it to First Responder's action.

提交回复
热议问题