Commit 5597ed0 1 parent 5cb5d6b commit 5597ed0 Copy full SHA for 5597ed0
File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
#import " FFFastImageView.h"
2
2
3
-
4
3
@interface FFFastImageView ()
5
4
6
5
@property (nonatomic , assign ) BOOL hasSentOnLoadStart;
7
6
@property (nonatomic , assign ) BOOL hasCompleted;
8
7
@property (nonatomic , assign ) BOOL hasErrored;
8
+ // Whether the latest change of props requires the image to be reloaded
9
+ @property (nonatomic , assign ) BOOL needsReload;
9
10
10
11
@property (nonatomic , strong ) NSDictionary * onLoadEvent;
11
12
@@ -97,7 +98,23 @@ - (void)sendOnLoad:(UIImage *)image {
97
98
- (void )setSource : (FFFastImageSource *)source {
98
99
if (_source != source) {
99
100
_source = source;
100
-
101
+ needsReload = YES ;
102
+ }
103
+ }
104
+
105
+ - (void )didSetProps : (NSArray <NSString *> *)changedProps
106
+ {
107
+ if (needsReload) {
108
+ [self reloadImage ];
109
+ }
110
+ }
111
+
112
+ - (void )reloadImage
113
+ {
114
+ needsReload = NO ;
115
+
116
+ if (_source) {
117
+
101
118
// Load base64 images.
102
119
NSString * url = [_source.url absoluteString ];
103
120
if (url && [url hasPrefix: @" data:image" ]) {
You can’t perform that action at this time.
0 commit comments