If I draw a rectangle on a frame and then I want to drag this rectangle to different positions on this frame. How could I do this? Please add comments if my description is unclear. It might be a bit confusing.
Share
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 create a
UIViewwith any background image and move it on a window by setting its frame asyourView.center = CGPointMake(x,y);You can detect the point of touch using any/all of
touchesBegan,touchesMovedortouchesEndedmethods as follows :These methods are to be declared in a
UIViewController. As sample code, you can refer to my github project in which I drag an item from oneUITableViewto anotherUITableViewwhich I’ve accomplished usingUIViews.