We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在removeBadgeView中只是 removeFromSuperview而没有取消对象关联属性 导致[self yee_BadgeLable]==nil 无法触发 也无法再次触发addSubview 方法就无法第二次调用 yee_MakeBadgeText方法 建议在 removeBadgeView方法中添加对象去除关联方法 objc_removeAssociatedObjects(self)
The text was updated successfully, but these errors were encountered:
谢谢,之前写没有考虑这么多,现在已经更新为1.0.2,之前的版本因为使用了masksToBounds部分属性会造成离屏渲染问题,1.0.1方法已经被舍弃,你看看BadgeViewDemo已经通过隐藏来实现,而不是移除。实际上到底是移除还是隐藏,这个都不是好的方法 1.如果对象只使用一次 ,如果不移除就会浪费内存空间2.如果多次使用,重复创建也会浪费内存, 我最后选择隐藏的方式.
Sorry, something went wrong.
if (![self.subviews containsObject:[self yee_BadgeLable]]) { [self addSubview:[self yee_BadgeLable]]; }
加了这句判断没问题了,最新的版本我更新不下来不知道怎么解决的
No branches or pull requests
在removeBadgeView中只是 removeFromSuperview而没有取消对象关联属性
导致[self yee_BadgeLable]==nil 无法触发 也无法再次触发addSubview 方法就无法第二次调用 yee_MakeBadgeText方法
建议在 removeBadgeView方法中添加对象去除关联方法
objc_removeAssociatedObjects(self)
The text was updated successfully, but these errors were encountered: