How do I name and link the IBAction button created in the storyboard

I called the "Reminders" button

Apparently, it should have been referencing files, but nothing appeared in mine.

I created a button in a storyboard, but I don’t know how to associate it with a .m or .h file.

I am really new to this and still learning. Should I change the button settings and the code that I write in the files to make it work?

Thanks heap!

+4
source share
1 answer

This is how you add IBOutlet to your header or .m file:

  • Open the storyboard editor in one window. Position it so that the button is visible.
  • Open the header or .m file in another window. Position the text so that the part of the code in which you want to add output is displayed.
  • Highlight the button in the storyboard and hold down the Control key.
  • Drag the button into the header or .m file. You will see a blue line when dragging and a blue marker where the socket will be added.
  • When the marker is in the place where you want, release the mouse button. The output will be inserted and connected to the storyboard.

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

+3
source

Source: https://habr.com/ru/post/1498819/


All Articles