Reputation: 89
I'm trying to add a custom property to my subclass of UIImageView. The property type is of UIImageView. I have success with other data types, UIColor, int, etc. But UIImageView just doesn't appear in the custom fields of the interface builder and I can't access it via code.
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface newLayerController : UIImageView
@property (nonatomic, copy) IBInspectable UIImageView *imageSheet;
- (void)drawShape:(CGPoint)point;
- (void)endTouch:(CGPoint)point;
- (void)startTouch:(CGPoint)point;
@end
Anyone know a quick fix?
Upvotes: 0
Views: 1290
Reputation: 31
Use UIImage instead UIImageView.
@IBInspectable var backImage: UIImage = UIImage() {
didSet{
setbackImage()
}
}
func setbackImage(){ self.image = backImage}
Upvotes: 3