Ios 移除并消除动画中使用的对象赢得';t零
使用Obj-c连续地为alpha设置动画,但是当我尝试为空并删除子视图时,它会粘住,并且不会删除或停止设置动画Ios 移除并消除动画中使用的对象赢得';t零,ios,objective-c,swift,Ios,Objective C,Swift,使用Obj-c连续地为alpha设置动画,但是当我尝试为空并删除子视图时,它会粘住,并且不会删除或停止设置动画 -(void)flashFingerPrint{ [UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{
-(void)flashFingerPrint{
[UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{
self.purpleFingerPrint.alpha = 0;
} completion:^(BOOL finished) {
nil;
}];
}
-(void)hidePurpleHelper {
if(nil != self.purpleFingerPrint && nil != self.purpleFingerPrint) {
// add it to the screen with animation
[UIView animateWithDuration:0.5 delay:0.2 options:(UIViewAnimationCurveEaseOut) animations:^{
self.purpleHelperView.alpha = 0;
self.purpleFingerPrint.alpha = 0;
self.purpleFingerPrint = nil;
[self.view willRemoveSubview:self.purpleFingerPrint];
} completion:^(BOOL finished) {
// nothing
self.purpleHelperView = nil;
self.purpleFingerPrint = nil;
[self.view willRemoveSubview:self.purpleFingerPrint];
}];
}
}
我调用了隐藏功能,但指纹仍显示在屏幕上并仍在闪烁?您需要
[self.purpleFingerPrint removeFromSuperview];
你需要
[self.purpleFingerPrint removeFromSuperview];
无需在此处重复检查
if(nil!=self.purpleFingerPrint&&nil!=self.purpleFingerPrint)
无需在此处重复检查if(nil!=self.purpleFingerPrint&&nil!=self.purpleFingerPrint)