我用PaintCode创建了各种图形。当我导出时,我得到一个生成的.m和.h文件。对于我的项目,这是生成的.h文件:
@interface StyleKit2 : NSObject
// Colors
+ (UIColor*)black;
+ (UIColor*)mustad_blue;
+ (UIColor*)mustad_grey;
+ (UIColor*)white;
+ (UIColor*)mustad_dark_grey;
+ (UIColor*)mustad_blue_half;
// Images
+ (UIImage*)image;
// Drawing Methods
+ (void)drawHorse_shoeWithFrame: (CGRect)frame;
+ (void)drawCogsWithFrame: (CGRect)frame;
+ (void)drawHoofWithFrame: (CGRect)frame ispressed: (BOOL)ispressed;
+ (void)drawHoof_camWithFrame: (CGRect)frame ispressed: (BOOL)ispressed;
+ (void)drawOrder_folderWithFrame: (CGRect)frame;
+ (void)drawSpalshWithFrame: (CGRect)frame;
+ (void)drawHorse_shoe_2WithFrame: (CGRect)frame;
+ (void)drawMustad_square_shapeWithFrame: (CGRect)frame;
+ (void)drawGrey_hoofWithFrame: (CGRect)frame ispressed: (BOOL)ispressed;
+ (void)drawHoof_unfilledWithIspressed: (BOOL)ispressed;
// Generated Images
+ (UIImage*)imageOfSpalshWithFrame: (CGRect)frame;
@end
为了在故事板中使用它,我添加了一个对象,并将自定义类设置为我的样式工具包。我添加了一个ImageView,右键单击我的stylekit进行拖动,但是。。我找不到Outlet Collection,难道我不能在这里使用我的绘图方法吗?
我做错了什么?
Outlet Collection仅适用于不带参数的画布。
您有:
+ (UIImage*)imageOfSpalshWithFrame: (CGRect)frame;
成功:
+ (UIImage*)imageOfSpalsh;