Using proper MCV with Objective-C can a UIView subclass have @propertys?
i.e. in the .h file
@class MyViewSubclass;
@interface MyViewSubclass : UIView
@property (strong, nonatomic) UILabel *labelLabel;
@property (strong, nonatomic) UILabel *valueLabel;
@end
or should this be done in a UIViewController subclass?
Thanks in advance.
It is most common to subclass UIViewController to manage the labels, fields, images, and other views within a view hierarchy. However, if you are creating a reusable component view that will be used throughout your application, then it’s perfectly appropriate to subclass UIView and add properties to your subclass.
From Apple’s iOS App Programming Guide:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AppArchitecture/AppArchitecture.html#//apple_ref/doc/uid/TP40007072-CH3-SW1