Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Xcode 5 assistant editor defaults to .m file

I realized that when launching assistance editor while working on a XIB file no longer opens the header file by default, instead it shows the implementation file. Is there a new workflow going on I am not aware of? While in the implementation file I can only seem to be able to add IBActions. What is the "new" way to create IBOutlets? Switching to header file each time??

like image 597
Mazyod Avatar asked Oct 22 '22 00:10

Mazyod


1 Answers

My 2 Cents:

When you create a new class using the Xcode templates, it usually provides a class extension in the implementation file for private properties. It makes a lot of sense to actually link the IBOutlets and IBActions there, because in most cases they are only ever used within the class itself.

The only exception to this that crosses my mind right now is UIView subclasses, and especially UITableViewCell. A lot of developers access the IBOutlets directly in cellForRowAtIndexPath:.

Apple engineers' message: Encapsulate your IBOutlets & IBActions whenever possible!

like image 108
Mazyod Avatar answered Oct 28 '22 22:10

Mazyod