Value of type '(CGRect) -> CGRect' has no member:是因为你变量类型定义错了

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

KyleBing
659 声望18 粉丝

前端,喜欢 Javascript scss,喜欢做一些实用的小工具