如何在 swift 中打印或记录 UIView 框架的值?

How to print or log the value of UIView frame in swift?

在我的应用程序中使用了一个 UILabel control.I 想要在我的 console.In objective c 中打印该标签的框架(x,y,宽度,高度)值我使用了 NSStringFromCGRect 函数打印 values.How 以使用 swift 在我的控制台中获取这些值?请帮助我。

let rect = CGRectMake(0.0, 0.0, 100.0, 100.0)
let label = UILabel(frame: rect)

print(label.frame)

打印 (0.0, 0.0, 100.0, 100.0)

很简单

 print(yourLabel.frame)