cgrectintersectsrect

How to access a layer inside UIView custom class generate with Paintcode?

余生颓废 提交于 2019-12-08 08:59:22
问题 I'm using Paintcode V3 and last Xcode for my project. In Paintcode I draw a red path, kind of "clock hand" with a radius variable to be able to rotate it. In my Xcode project, this custom UIView is added to a main view. When the red path is rotating, I need to know when it intersects with another element of the view. I tried: if self.redPathView.frame.intersects(self.anotherView.frame) { //do something... } but it can't work because redPathView is the entire Paintcode canvas (the square frame

How to access a layer inside UIView custom class generate with Paintcode?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 00:59:27
I'm using Paintcode V3 and last Xcode for my project. In Paintcode I draw a red path, kind of "clock hand" with a radius variable to be able to rotate it. In my Xcode project, this custom UIView is added to a main view. When the red path is rotating, I need to know when it intersects with another element of the view. I tried: if self.redPathView.frame.intersects(self.anotherView.frame) { //do something... } but it can't work because redPathView is the entire Paintcode canvas (the square frame) and not only the red path. I'm searching a way to access to the red path of my view. Interesting