Value of type ‘(CGRect) -> CGRect’ has no member ‘maxY’

Value of type '(CGRect) -> CGRect' has no member 'maxY'
Value of type '(CGRect) -> CGRect' has no member 'maxX'
Value of type '(CGRect) -> CGRect' has no member 'width'
Value of type '(CGRect) -> CGRect' has no member 'height'
Value of type '(CGRect) -> CGRect' has no member 'size'

是因为你定义的某个变量属性不对,多半应该是 ​​CGFloat​​​,而你没有规定变量类型,系统默认识别成了 ​​Int​​​ 或者 ​​Double​​ 类型

let frameWidth = 300 // 识别为 Int

// 改为
let frameWidth: CGFloat = 300