Subclassing YYImage
GiuseppePiscopo opened this issue · 0 comments
GiuseppePiscopo commented
Hello all,
hope there's still someone reading this. In a number of issues the answerer suggests to solve problem by subclassing YYImage, eg. #1 , #36 , #146 .
Say that MyImage
is the subclass name. The point is that, as soon as one tries to invoke MyImage(named: "whatever")
, you get into typical errors of missing initializers in subclass.
Q1: Why does every suggestion completely misses to mention that? Maybe there's something wrong we're doing and I'm missing something evident.
Q2: We'd like to avoid duplicating code from YYImage class factory methods like:
+ (YYImage *)imageNamed:(NSString *)name
or from initializers:
- (instancetype)initWithData:(NSData *)data scale:(CGFloat)scale
but then there seems to be no way to invoke those from the subclass initializer, at least not from Swift.