将Swift 2代码转换为Swift 3

时间:2016-08-02 12:08:26

标签: swift swift3 migration

如何将以下代码转换为Swift 3

let size = text.boundingRectWithSize(CGSizeMake(view.frame.width - 26, 2000), options: NSStringDrawingOptions.UsesFontLeading.union(.UsesLineFragmentOrigin), context: nil).size

1 个答案:

答案 0 :(得分:2)

这有用吗?

let size = text.boundingRect(with: CGSize(width: view.frame.width - 26, height: 2000), options: NSStringDrawingOptions.usesFontLeading.union(.usesLineFragmentOrigin), context: nil).size