I have a custom UIView, holder.
I have another custom UIView from a different class, and the instance is named letter.
When letter touches holder, i want holder to respond.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can check that the intersection of the two views’ frames is null. Use the
framemethod on the UIView class to get the CGRect frame of each view, then callCGRectIntersectionto find the rectangles’ overlapping area, if any. If they don’t touch, the intersection will be the null rectangle (i.e. will return true forCGRectIsNull).Code, untested: