How do I name and link an IBAction button created in a storyboard

江枫思渺然 提交于 2019-12-01 19:50:39

Here is how you add an IBOutlet to a header or a .m file:

  1. Open your storyboard editor on one window. Position it in such a way that the button is visible
  2. Open the header or the .m file in another window. Position the text in such a way so that the piece of code where you want the outlet added is visible
  3. Highlight the button in the storyboard, and hold the Control key down.
  4. Drag the button into the header or the .m file. You will see a blue line as you drag, and a blue marker where the outlet will be added.
  5. When the marker is at the place where you want it, release the mouse button. The outlet will be inserted and connected to the storyboard.

Here is a post that illustrates this process with a video.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!