I want to make a game in swift (xcode7) and I have a ball which may intersect with obstacles. But I've got different levels so I can't simply use CGRectIntersectsWithCGRect
. Only if I use a switch, which would be the longest in the world and wouldn't look that nice..
So in my head I've a method like this:
ball.intersectsWithRect()->CGRect
or:
CGRectIntersectsRect(ball.frame, /*anyframe / anyview.frame*/)
But I couldn't find anything like this. Is that even possible? Or is there even a simpler way to do it?