IBAction - why declare them in the header file

I notice that it is common practice to declare IBAction methods in the header file. I also noticed that this is not necessary for Interface Builder to recognize IBAction methods and let me associate them with controls. So what is the purpose of declaring an IBAction method in a header file?

+4
source share
1 answer

There is no good reason if you have no good reason to disclose them to other people or if you need to open the tips in the Builder.app interface.

Some people may do this for historical reasons or out of habit. Prior to Xcode 4, a separate nibs (Interface Builder) editing application was added. The Builder interface was not supported by the compiler as you know it in Xc4; He just used the base objc parser to interpret the headers. Over time, he learned to communicate with Xcode. Previously, you had to drag and drop headers to sync them;)

+2
source

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


All Articles