parent
5cb5d6bab3
commit
5597ed0dad
|
@ -1,11 +1,12 @@
|
||||||
#import "FFFastImageView.h"
|
#import "FFFastImageView.h"
|
||||||
|
|
||||||
|
|
||||||
@interface FFFastImageView()
|
@interface FFFastImageView()
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL hasSentOnLoadStart;
|
@property (nonatomic, assign) BOOL hasSentOnLoadStart;
|
||||||
@property (nonatomic, assign) BOOL hasCompleted;
|
@property (nonatomic, assign) BOOL hasCompleted;
|
||||||
@property (nonatomic, assign) BOOL hasErrored;
|
@property (nonatomic, assign) BOOL hasErrored;
|
||||||
|
// Whether the latest change of props requires the image to be reloaded
|
||||||
|
@property (nonatomic, assign) BOOL needsReload;
|
||||||
|
|
||||||
@property (nonatomic, strong) NSDictionary* onLoadEvent;
|
@property (nonatomic, strong) NSDictionary* onLoadEvent;
|
||||||
|
|
||||||
|
@ -97,7 +98,23 @@
|
||||||
- (void)setSource:(FFFastImageSource *)source {
|
- (void)setSource:(FFFastImageSource *)source {
|
||||||
if (_source != source) {
|
if (_source != source) {
|
||||||
_source = source;
|
_source = source;
|
||||||
|
needsReload = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)didSetProps:(NSArray<NSString *> *)changedProps
|
||||||
|
{
|
||||||
|
if (needsReload) {
|
||||||
|
[self reloadImage];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)reloadImage
|
||||||
|
{
|
||||||
|
needsReload = NO;
|
||||||
|
|
||||||
|
if (_source) {
|
||||||
|
|
||||||
// Load base64 images.
|
// Load base64 images.
|
||||||
NSString* url = [_source.url absoluteString];
|
NSString* url = [_source.url absoluteString];
|
||||||
if (url && [url hasPrefix:@"data:image"]) {
|
if (url && [url hasPrefix:@"data:image"]) {
|
||||||
|
|
Loading…
Reference in New Issue