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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:06:46+00:00 2026-06-12T02:06:46+00:00

I have a UITextview, becomes first responder and keyboard is presented. Presently, I have

  • 0

I have a UITextview, becomes first responder and keyboard is presented. Presently, I have buttons in inputAccessoryView toolbar that exchange the text forward and reverse through an array of strings.
I have the process working with no issues, so of course I am inclined to break it. My wish is to slide the textview left and right like a carousel to make it more clear to the user that next or previous string is coming and going. The current system simply replaces the text with no animation.

My first thought was to create a UINavigationController, give it an array of UIViewControllers that present the UITextviews. The navigation controllers view is only as big as the textview and I add it as a subview to my full view (which is itself in a navigation controller). I got this working fairly completely, the navigation bar is hidden and it looks no different than the original textview except that the textview now slides off to the right or left, depending if I am pushing or popping.
The problem with that is that the keyboard slides off along with the dismissed view controller, then the new textview in the new controller becomes first responder and the keyboard returns. Close, but no cigar.

I considered using page view controller but it seems it will have the same issue. I think I may have to go back to the single textview and animate the whole process directly with static screen grabs. That is completely beyond my experience level and I am think there must be a simpler way.

Can anyone suggest a simple way to keep that keyboard present while the views are swapped as described? Suggestions on other angles of attacking 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-12T02:06:47+00:00Added an answer on June 12, 2026 at 2:06 am

    Seems like an awful lot of overhead for a simple animation.

    Try something like this (assuming ARC):

    typedef enum _eDirection
    {
        rightToLeft = -1,
        leftToRight = 1
    } eDirection;
    
    - (void) animateTextFields:(eDirection)direction
    {
        CGFloat distance = self.window.bounds.size.width;
        UITextField *oldTextField = thisView.textField;
        CGRect oldTFRect = oldTextField.frame;
        CGRect newTFRect = CGRectOffset(oldTFRect, -direction * distance, 0);
        UITextField *newTextField = [[UITextField alloc] initWithFrame:newTFRect];
        [newTextField setText:@"whatever"];
        [self addSubview:newTextField];
        [UIView animateWithDuration:0.3f
                         animations:^{
                             [oldTextField setFrame:CGRectOffset(oldTextField.frame, direction * distance, 0)];
                             [newTextField setFrame:CGRectOffset(newTextField.frame, direction * distance, 0)];
                         } completion:^(BOOL finished) {
                             [self setTextField:newTextField];
                             [self removeSubview:oldTextField];
                             [newTextField becomeFirstResponder];
                         }];
     }
    

    (Disclaimer: as with all code typed off the top of one’s head, etc., etc.)

    This method would create a new textField, animate it horizontally onto the screen while moving the existing one off the screen in the direction you give, and then assigns the new textField as the current one and makes it the firstResponder.

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

Sidebar

Related Questions

I have a UITextView on a View that becomes the first responder. When I
I have a UITextView that is supposed to have one line of text. The
I have a UITextView that I shrink upon bringing up the keyboard. An issue
I have a UITextView with text that needs to be scrolled to see the
is there any way to get notified when e.g. a UITextView becomes first responder?
I have a UITextView and 2 UITextField set up. UITextView resigns first responder status
I have a UITextView and i want to paste text into that UITextView with
I have a UITextView with a toolbar above it, when the text is selected
I have a UITextView and I want have two buttons. When the user taps
I have a UITextView that works well, till it's content is larger than it's

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.