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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:06:31+00:00 2026-05-25T13:06:31+00:00

I have a view basic UITextField and submit button. When the user taps in

  • 0

I have a view basic UITextField and “submit” button. When the user taps in the UITextField the keyboard appears. I shift the view up so the useful bits aren’t blocked by the keyboard and when they keyboard goes away I shift stuff back down again (registered for keyboard show/hide notifications).

I want users to be able to tap anywhere in the view to ditch the keyboard. So I added a UITapGestureRecognizer and I call resignFirstResponder on my text field. Works great…. mostly.

If you tap the “submit” button it doesn’t work. It’s not cancelsTouchesInView, I set that to NO. It’s the moving view. The “tap” gets registered in the post shift down view. So when I slide the view down 80 points the tap the user made “on the button” winds up being 80 points above the button.

So how do I get that tap passed through before the Gesture Recognizer event fires and causes the view to shift?

  • 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-05-25T13:06:32+00:00Added an answer on May 25, 2026 at 1:06 pm

    I found a fix which works best for me.

    UIGestureRecognizerDelegate has a method – gestureRecognizer:shouldReceiveTouch: which lets you choose say if the gesture recognizer should accept the touch.

        - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
            if ([touch.view isKindOfClass:[UIControl class]])
                return NO;
            return YES;
        }
    

    In essence, if the tap happened on anything which is a sub-class of a UIControl object, let that object handle the click, otherwise my gesture recognizer gets it.

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

Sidebar

Related Questions

I have a basic view with a UITextField and a Tableview. I am able
I have a View where the user can select Basic Configuration and Advanced Configuration
I have a view user control that can post form. This control can be
Pretty Basic one here guys. I have a View which holds 2 textfields for
So i have this very basic ipad view controller and i was doing some
I have a basic view that returns the same columns as a table (give
I have a basic View created in IB containing a UITableView and a UITextVIew.
I have a basic map view in my app which contains a set of
Hi I have very basic question. I have view like below: def view1: dict
I have a very basic view controller class, created via interface builder. it only

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.