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 8251649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:18:20+00:00 2026-06-08T00:18:20+00:00

In my app, you can touch the screen and an editable UITextField appears on

  • 0

In my app, you can touch the screen and an editable UITextField appears on the screen. I want to be able to move these newly added UITextFields around the screen. I would also like to add a rotation gesture and a pinch gesture. This is very difficult to do right now, because every time the screen is tapped a new SubView is added (UITextField). Below is my coding:

- (IBAction)addText:(UITapGestureRecognizer *)recognizer 
{ 
   if (recognizer.state == UIGestureRecognizerStateEnded) 
   {       
        UITextField *newText = [[UITextField alloc] initWithFrame:CGRectMake(40, 205, 280, 128)];
        newText.hidden = NO;
        [self.view addSubview:newText];
        newText.text = @"phrase";
        [newText setFont:[UIFont fontWithName:@"ArialRoundedMTBold" size:60]];
        newText.borderStyle = UITextBorderStyleNone;
        UIPanGestureRecognizer *pan= [[UIPanGestureRecognizer alloc] initWithTarget:newText action:nil];

        CGPoint translation = [pan translationInView:newText];
        pan.view.center = CGPointMake(pan.view.center.x + translation.x, pan.view.center.y + translation.y);
        [pan setTranslation:CGPointMake(0,0) inView:self.view];
     }
}
  • 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-08T00:18:21+00:00Added an answer on June 8, 2026 at 12:18 am

    There are a few ways to set up dependencies between gesture recognizers. One way which seems useful here is the requireGestureRecognizerToFail: method. After you create the pan recognizer, add this:

    [recognizer requireGestureRecognizerToFail:pan];
    

    Now the tap recognizer (in the recognizer variable) won’t activate unless the pan recognizer has decided that the user is not panning.

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

Sidebar

Related Questions

I know I can get touch events in my iPhone app. But these touch
I'm building a touch screen kiosk application in .NET (C#, WPF). the app itself
I am working on a winform app for a touch screen monitor. The app
I have an app where u can move a man with the accelerometer. There
I'm going to be driving a touch-screen application (not a web app) that needs
In an iPad app, wherever a user is touching the screen I want to
I am getting these errors in log cat every time I touch the screen
I am experiencing a problem with my app. The 1st screen that appears is
I have some iPad app where user will navigate using touch screen OR bluetooth
My iPhone app can't seem to use soft keyboards that doesn't use the US-like

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.