123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #import "ReaderThumbView.h"
- @implementation ReaderThumbView
- {
- NSOperation *_operation;
- NSUInteger _targetTag;
- }
- #pragma mark - Properties
- @synthesize operation = _operation;
- @synthesize targetTag = _targetTag;
- #pragma mark - ReaderThumbView instance methods
- - (instancetype)initWithFrame:(CGRect)frame
- {
- if ((self = [super initWithFrame:frame]))
- {
- self.autoresizesSubviews = NO;
- self.userInteractionEnabled = NO;
- self.contentMode = UIViewContentModeRedraw;
- self.autoresizingMask = UIViewAutoresizingNone;
- self.backgroundColor = [UIColor clearColor];
- imageView = [[UIImageView alloc] initWithFrame:self.bounds];
- imageView.autoresizesSubviews = NO;
- imageView.userInteractionEnabled = NO;
- imageView.autoresizingMask = UIViewAutoresizingNone;
- imageView.contentMode = UIViewContentModeScaleAspectFit;
- [self addSubview:imageView];
- }
- return self;
- }
- - (void)showImage:(UIImage *)image
- {
- imageView.image = image;
- }
- - (void)showTouched:(BOOL)touched
- {
-
- }
- - (void)removeFromSuperview
- {
- _targetTag = 0;
- [self.operation cancel];
- [super removeFromSuperview];
- }
- - (void)reuse
- {
- _targetTag = 0;
- [self.operation cancel];
- imageView.image = nil;
- }
- @end
|