Swift 4 Expression type '@value CGRect' is ambiguous without more context
I got here looking for an answer to what was causing the error "Expression type '@lvalue CGRect' is ambiguous without more context", and while nothing here answered this for me I did find the solution to the problem so I'll leave it here for anyone else who stumbles on this question via Google. When creating your CGRect make sure to explicitly cast any ambiguous values to CGFloats (e.g. var width = CGFloat(100)) instead of relying on the compiler to infer the correct type/cast for you.