Better IBActions

This is a small thing, but I am not sure how I have never seen anyone describe this feature of creating IBActions with storyboards, and quick googling doesn’t show me anything obvious.

But when you ctrl-click-drag from UIButton (UIControl) into the implementation section of code in a .m, you get a popup for naming the IBAction that looks like this:

initialView

<yawn> Yes, we all know that. But as you can see there are options that can be used, and sometimes we should!

Instead of using the standard event TouchUpInside: #

ibButton - events.png

Nor does the sender need to be typed to the default (id)sender: #

ibButton 1.png

Lastly, you can choose which arguments are sent to the method: #

ibButton choose arguments.png

Being able to choose the type of event right there in the pop-up is great, I was previously, using the side “Attributes Inspector” to drag and connect things. Not as simple.

Being able to have the argument as a typed argument is a nice thing, rather than doing it by hand or not doing at all, thus depriving the compiler to help along with method completions.

And I was simply unaware that I could send the event as an argument to the method, and that is something that I am sure will be very helpful.

 
0
Kudos
 
0
Kudos

Now read this

Faster build times by leveraging multi-core CPU!

How in the world is this not the default and how have I not heard of this before?!? Buried in this helpful blog post about making your XCode life easier, is this tip: Faster build times by leveraging multi-core CPU ? defaults write... Continue →