我有一个非常简单的标签。像这样:
let label = UILabel()
label.numberOfLines = 3
label.text = "hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!hello world!"
label.snp.makeConstraints { (make) in
make.left.top.equalToSuperview().offset(30)
make.right.equalToSuperview().offset(30)
}
addSubview(label)
我已经分配了label.numberOfLines = 3,现在我想知道第三行的文本长度。我怎么计算呢?感谢