Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8841869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:49:30+00:00 2026-06-14T10:49:30+00:00

Newbie obj-c question. My task is to make visually represented test for iPad. In

  • 0

Newbie obj-c question.

My task is to make visually represented test for iPad. In view I have three UIImages (with images of answers to test question) what will dragged to area for answer. If selected right image, then it needs to stay in this area, if not – it goes back into the start position. If user stop dragging not in area for answer it also needs to goes back to the start position.
I tried to implement this: http://www.cocoacontrols.com/platforms/ios/controls/tkdragview but it’s too hard for me because I am a super newbie.

I implemented simple dragging of images by PanRecognizer, so every from three images dragging

 -(IBAction)controlPan:(UIPanGestureRecognizer *)recognizer {
CGPoint translation = [recognizer translationInView:self.view];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
}

If I think in right way, I need to set CGPoint’s with start and destination coordinates and then to customize Pan Gestures method? If it’s not right, in what way can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:49:32+00:00Added an answer on June 14, 2026 at 10:49 am

    You can consider this three method, maybe these are easier for you:

    – touchesBegan:withEvent:
    – touchesMoved:withEvent:
    – touchesEnded:withEvent:
    

    Detailed demo for – touchesBegan:withEvent: is:

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
        [super touchesBegan:touches withEvent:event];
        UITouch *touched = [[event allTouches] anyObject];
        CGPoint location = [touch locationInView:touched.view];
    }
    
    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    {
        [super touchesMoved:touches withEvent:event];
        UITouch *touched = [[event allTouches] anyObject];
        // Here I suppose self.imageView contains the image user is dragging.
        CGPoint location = [touch locationInView:touched.view];
        // Here the check condition is the image user dragging is absolutely in the answer area.
        if (CGRectContainsRect(self.answerArea.frame, self.imageView.frame)) {
            // set transition to another UIViewController
        } else {
            self.imageView.center = location;    // Here I suppose you just move the image with user's finger.
        }
    }
    

    Here is the Apple’s doc for this UIResponder Class Reference

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Total newbie Iphone/ Obj. C question: I have a class called Location, in the
Newbie obj-c question. I am writing a simple iPad presentation not for Appstore. My
Newbie question... The objective: I intend to have an HTML text input field as
Newbie question: There are three types of Asp.Net controls : HTML server controls, Web
I have a PyMongo newbie question: If collection is a PyMongo Collection and I
I have a newbie question about the following: - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
A JavaScript newbie here. I have this following code: function testObject(elem) { this.test =
I have very newbie question. How can i check that object of model is
Newbie question here but for some reason I cant figure this out. I have
I have a question. I am a newbie with Run Time Type Information from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.