iOS: add removeObserver in case addObserver being called multi times
This commit is contained in:
parent
2d1cf3fcfe
commit
5eb47355e0
@ -557,6 +557,13 @@ - (void)blendView:(UIImageView *)view forPropName:(NSString *)name propValue:(id
|
|||||||
} else if ([@"imageScale" isEqualToString:name]) {
|
} else if ([@"imageScale" isEqualToString:name]) {
|
||||||
//Do not need set
|
//Do not need set
|
||||||
} else if ([@"onAnimationEnd" isEqualToString:name]) {
|
} else if ([@"onAnimationEnd" isEqualToString:name]) {
|
||||||
|
if (self.animationEndCallbackId) {
|
||||||
|
#if DORIC_USE_YYWEBIMAGE
|
||||||
|
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentIsPlayingAnimation" context:nil];
|
||||||
|
#elif DORIC_USE_SDWEBIMAGE
|
||||||
|
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentFrameIndex" context:nil];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
self.animationEndCallbackId = prop;
|
self.animationEndCallbackId = prop;
|
||||||
DoricImageView *doricImageView = (DoricImageView *) view;
|
DoricImageView *doricImageView = (DoricImageView *) view;
|
||||||
#if DORIC_USE_YYWEBIMAGE
|
#if DORIC_USE_YYWEBIMAGE
|
||||||
|
Reference in New Issue
Block a user