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.
Written by Jessica Lam
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Best practices
Authors
padawin
28.02K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#