pikacode/EBBannerView

关于UIView animateWithDuration weakSelf的疑问

leaDongYang opened this issue · 4 comments

WEAK_SELF(weakSelf); CGFloat originHeight = self.contentLabel.frame.size.height; [UIView animateWithDuration:_maker.animationDuration animations:^{ weakSelf.frame = CGRectMake(weakSelf.fixedX, weakSelf.fixedY, weakSelf.fixedWidth, weakSelf.standardHeight + weakSelf.calculatedHeight - originHeight + 1); } completion:^(BOOL finished) { weakSelf.frame = CGRectMake(weakSelf.fixedX, weakSelf.fixedY, weakSelf.fixedWidth, weakSelf.standardHeight + weakSelf.calculatedHeight - originHeight + 1); }];
楼主你好,看到这里你写的weakSelf我想问下,为什么用weakSelf,这里应该并不具有循环强引用

居然偷看我源代码😲

你之前的问题到底解决没解决啊

我不用keywindow了,就好了,因为我自己封装的控件也用UIVIew animation,这里不需要weakSelf吧

是哇