YBAttributeTextTapAction icon indicating copy to clipboard operation
YBAttributeTextTapAction copied to clipboard

一行代码添加文本点击事件/a fast way to implement click event text

Results 15 YBAttributeTextTapAction issues
Sort by recently updated
recently updated
newest added

在- (CGSize)yb_textSizeWithAttributedString:(NSAttributedString *)attributedString width:(float)width numberOfLines:(NSInteger)numberOfLines 中添加 sizeLabel.font = self.font; 因为项目需求基本也只是在高亮区设置font 这样写省事

直接在您的demo基础之上,我把lab改成了固定高度,让内容显示不全。 再测试点击事件,都是有问题的。

老哥,中间加了 NSTextAttachment 图片 会导致计算范围不准确,这个问题有修复吗?

你好,下载了你的demo运行,如果我首先设置label的行数,再点击展开就无效果, 这是为什么呢?在demo的第0组我是这样设置的 cell.testTapLabel.numberOfLines = 2; cell.testTapLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; 然后展开就无响应了

### 必须设置字体属性,不然点击范围会不准确,重要的事情说三遍 ### 必须设置字体属性!必须设置字体属性!必须设置字体属性! eg: ``` [totalStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:orginFont] range:NSMakeRange(0, string.length)]; ```

question

eg: let label = UILabel() let labelStr = """ 今天是个好日子 practice; custom; tradition; convention """ label.attributedText = NSMutableAttributedString.init(string: labelStr) label.yb_addAttributeTapAction(with:["practice","custom","tradition","convention"], delegate: self) r: 在代理方法中,打印,当我点击"tradition"的时候,打印输出显示string是convention的问题,请问我应该如何解决这个问题

![image](https://user-images.githubusercontent.com/13517061/57826889-cea36700-77d7-11e9-97dd-ec41e0876ec2.png)