Last Updated: February 25, 2016
·
2.697K
· kangaroo5383

Cleaner code with objective-c categories for protocol implementations

instead of

@ interface MYAwesomeViewController : UIViewController <all,protocol,lots,of, stuff>...

in your .h

I usually define a category for protocols in my .m files and implement the protocol methods in its own category:

@ interface MYAwesomeViewController (protocol) <some,protocol,stuff>

That way, the implementation will be in their own category as oppose to making my implementation section cluttered. I reserve that section for subclassing purposes or custom setters and getters.