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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:39:51+00:00 2026-05-26T08:39:51+00:00

I’ve been wondering if it is possible to replicate the behavior of Apple’s iOS5

  • 0

I’ve been wondering if it is possible to replicate the behavior of Apple’s iOS5 keyboard in the messages app, without using any private API calls. When you scroll down past the keyboard in the messages app, the keyboard will collapse leaving more room to see messages – try it to see.

I couldn’t find anything that points towards making this without having to start jumping through some serious hoops to get an instance of the Keyboard’s View. And I’m pretty sure Apple wouldn’t be happy with that.

In addition to the answer given below you can see a fully baked xcode project of my implementation here:
https://github.com/orta/iMessage-Style-Receding-Keyboard

  • 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-26T08:39:52+00:00Added an answer on May 26, 2026 at 8:39 am

    This is an incomplete solution, however it should give you a good starting point.

    Add the following ivars to your UIViewController:

    CGRect        keyboardSuperFrame; // frame of keyboard when initially displayed
    UIView      * keyboardSuperView;  // reference to keyboard view
    

    Add an inputAccessoryView to your text controller. I created an small view to insert as the accessoryView:

    accView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
    accView.backgroundColor = [UIColor clearColor];
    textField.inputAccessoryView = accView;
    

    I added the above code to -(void)loadView

    Register to receive UIKeyboardDidShowNotification and UIKeyboardDidHideNotification when view is loaded:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        [[NSNotificationCenter defaultCenter] addObserver:self
            selector:@selector(keyboardWillShow:)
            name:UIKeyboardWillShowNotification
            object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self
            selector:@selector(keyboardDidShow:)
            name:UIKeyboardDidShowNotification
            object:nil];
        return;
    }
    

    Add methods to specified as the selectors for the notifications:

    // method is called whenever the keyboard is about to be displayed
    - (void)keyboardWillShow:(NSNotification *)notification
    {
        // makes keyboard view visible incase it was hidden
        keyboardSuperView.hidden = NO;
        return;
    }
    // method is called whenever the keyboard is displayed
    - (void) keyboardDidShow:(NSNotification *)note
    {
        // save reference to keyboard so we can easily determine
        // if it is currently displayed
        keyboardSuperView  = textField.inputAccessoryView.superview;
    
        // save current frame of keyboard so we can reference the original position later
        keyboardSuperFrame = textField.inputAccessoryView.superview.frame;
        return;
    }
    

    Add methods to track touched and update keyboard view:

    // stops tracking touches to divider
    - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    {
        CGRect newFrame;
        CGRect bounds = [[UIScreen mainScreen] bounds];
    
        newFrame = keyboardSuperFrame;
        newFrame.origin.y = bounds.size.height;  
    
        if ((keyboardSuperView.superview))
            if (keyboardSuperFrame.origin.y != keyboardSuperView.frame.origin.y)
                [UIView animateWithDuration:0.2
                        animations:^{keyboardSuperView.frame = newFrame;}
                        completion:^(BOOL finished){
                                    keyboardSuperView.hidden = YES;
                                    keyboardSuperView.frame = keyboardSuperFrame;
                                    [textField resignFirstResponder]; }];
        return;
    }
    
    
    // updates divider view position based upon movement of touches
    - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    {
       UITouch  * touch;
       CGPoint    point;
       CGFloat    updateY;
    
       if ((touch = [touches anyObject]))
       {
          point   = [touch locationInView:self.view];
          if ((keyboardSuperView.superview))
          {
             updateY = keyboardSuperView.frame.origin.y;
             if (point.y < keyboardSuperFrame.origin.y)
                return;
             if ((point.y > updateY) || (point.y < updateY))
                updateY = point.y;
             if (keyboardSuperView.frame.origin.y != updateY)
                keyboardSuperView.frame = CGRectMake(keyboardSuperFrame.origin.x,
                                                     point.y,
                                                     keyboardSuperFrame.size.width,
                                                     keyboardSuperFrame.size.height);
          };
       };
       return;
    }
    

    Disclaimers:

    • When resigning as first responded, the keyboard moves back to its original position before sliding off screen. To make dismissing the keyboard more fluid, you first need to create an animation to move the keyboard off of the screen and then hide the view. I’ll leave this part as an exercise to the readers.
    • I’ve only tested this on the iOS 5 simulator and with an iPhone with iOS 5. I have not tested this with earlier versions of iOS.

    The SlidingKeyboard project I created to test this concept is available from GitHub in the examples directory of BindleKit:

    https://github.com/bindle/BindleKit

    Edit: Updating example to address first disclaimer.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.