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??
Asked
Active
Viewed 885 times
5

Mazyod
- 22,319
- 10
- 92
- 157
1 Answers
3
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!

Mazyod
- 22,319
- 10
- 92
- 157
-
2I agree with you on Apple's intention, but it's bad practice to do this for everything if you want to unit test your code. – shawnwall Dec 09 '13 at 17:14