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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:42:18+00:00 2026-06-06T14:42:18+00:00

I have a UIView subclass with an added observer for the UIKeyboardWillShowNotification and UIKeyboardWillHideNotification

  • 0

I have a UIView subclass with an added observer for the UIKeyboardWillShowNotification and UIKeyboardWillHideNotification. This UIView is in a UITableViewCell subclass. I have two other UITableViewCell subclasses that contain UITextFields. When those text fields are tapped, my custom UIView receives those notifications. I have these three UITableViewCell subclasses setup for a email composer view type of thing.

How can I make sure that when my UIView subclass receives the keyboard will show or hide notification that it is for the UIView and not to the other UITableViewCell's that contain ui text fields?

I should mention that I have a UIWebView in my UIView subclass. When a contenteditable div is tapped, I want to receive notification that the keyboard came up but only for my UIWebView instance.

I was thinking I could do the following, but that doesn’t seem to work.

[[NSNotificationCenter defaultCenter] addObserver:self selector@(selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:_webView];
  • 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-06T14:42:19+00:00Added an answer on June 6, 2026 at 2:42 pm

    I think it depends for what you need the UIKeyboardNotification, you can achieve the same thing with:

    - (void)textFieldDidBeginEditing:(UITextField *)textField
    

    To see when the editing did begin. And this to see when the editing did end:

    - (void)textFieldDidEndEditing:(UITextField *)textField
    

    Don’t forget your UITableViewCells must comply with the UITextFieldDelegate protocol.

    Quick reference about the UITextFieldDelegate protocol.


    Edit: One more thing, the solution I gave you makes sense when you have the need to know when a specific UITextField became first responder. If you don’t care about that, and you just need to know when the keyboard actually comes and goes, you should notify the UIViewController that have your UITableView instead of each individual cell. The UIViewController should then take the proper action.

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

Sidebar

Related Questions

I created a subclass of UITableViewCell and added two identical UIView s that have
I have a UIView subclass ( CustomView for purposes of this question) that has
I have a UIView subclass that registers itself and an observer with an object
I have an object that is a subclass of UIView that can be added
I have a UIView subclass that draws a simple rectangle with this code: -
I have a UIView subclass, and within this I call this other UIView subclass.
I have a UIView subclass that draws itself when -drawRect: is called. It only
I want to have a UIView subclass that has a border image, but I
So I have a Subclass of UIView that is suppose to detect touches. The
I have a UIView that gets added to my UITableView .view as a subview.

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.