Search code examples
iosswiftcgpath

'CGAffineTransform' is not convertible to 'ConstUnsafePointer<CGAffineTransform>'


I get the error message in the title when using this:

CGPathContainsPoint(Hitbox.CGPath, self.transform, point, false)

Hitbox is a UIBezierPath, self is a UIView and point is a CGPoint.

I have absolutely no idea what to search for or what this error is, please dont be too harsh. How should I correct this error?


Solution

  • That function takes a pointer to a CGAffineTransform struct, rather than a struct value. So you need to do something like this:

    CGAffineTransform transform = self.transform;
    CGPathContainsPoint(Hitbox.CGPath, &transform, point, false)