Can't drag and drop item from storyboard to viewcontroller in xcode

前端 未结 13 1694
不知归路
不知归路 2021-02-02 10:54

I started working with xcode a few days ago, and today I tried to connect a textview from the main storyboard to the viewcontroller, but I figured out that its not working.

13条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-02 11:50

    Make sure you're in Assistant Editor Mode (When code and layout editor are side-by-side).

    From Apple:

    With Interface Builder open in the standard editor pane, select the control you want to configure, and click the Assistant Editor button () in the workspace toolbar. The assistant editor opens your object’s implementation file.

    Control-drag from the control in Interface Builder to the implementation file. (In the screenshot, the assistant editor displays the implementation file of the view controller for the Warrior button.) Xcode indicates where you can insert an action method in your code.

提交回复
热议问题