Using View Frame when inside.

44 Views Asked by At

I have an image view controlled by accelerometer and they are able to go out of the screen, how is it possible to detect if the image view is out of the screen and not visible to the user. I have tried using CGRectIntersectsRect and I also used self.view.frame but when my image view spawned it immediately detected it cause it was already in the view.

1

There are 1 best solutions below

0
On BEST ANSWER

You need to use convertRect: toView: and CGRectIntersect which will return CGRect and then you can compare both using CGRectEqualToRect

For sample you can follow this