0
我想添加一個自定義屬性到我的UIImageView的子類。屬性類型是UIImageView。我已經成功地使用了其他數據類型,UIColor,int等。但是UIImageView並沒有出現在界面構建器的自定義字段中,我無法通過代碼訪問它。IB_DESIGNABLE和IBINSTECTABLE UIImageView
#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
任何人都知道一個快速修復?
你不能有ibinspectable uiimageview。您可以擁有@property(非原子,複製)IBInspectable UIImage *圖像;您可以在代碼中將其分配給視圖。 –