Change float to CGFloat to resolve an arm64 compilation error