Value of type ‘(cgrect) – > cgrect’ has no member: it’s because you define the wrong variable type

Time:2021-1-25

Value of type ‘(cgrect) – > cgrect’ has no member: it’s because you define the wrong variable type

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'

It’s because the attribute of a variable you defined is wrong. It should beCGFloatAnd you don’t specify the variable type. The system recognizes it by defaultIntperhapsDoubletype

Let framewidth = 300 // recognized as int

//Change to
let frameWidth: CGFloat = 300