GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Can't make message input bar first responder? · Issue #24 · MessageKit/MessageInputBar

Can't make message input bar first responder? #24

New issue
Copy link
New issue
Copy link
Open
Open
Can't make message input bar first responder?#24
Copy link

Description

@AttilaTheFun
AttilaTheFun
opened on Mar 14, 2019
Issue body actions

I've tried calling:
self.becomeFirstResponder()
self.messageInputBar.becomeFirstResponder()
self.messageInputBar.inputTextView.becomeFirstResponder()

From viewDidLoad, viewWillAppear, and viewDidAppear and I still can't get the keyboard to open automatically for my view controller. For normal text views, calling becomeFirstResponder() should automatically focus them and present the keyboard. What gives? Is there a workaround?

Activity

  1. nathantannar4 commented on Mar 15, 2019

    @nathantannar4
    nathantannar4
    on Mar 15, 2019
    Member
    More actions

    Is the MessageInputBar visible? It's an input accessory view so the view controller needs to be the first responder to have the bar be presented

    Sent with GitHawk

  2. AttilaTheFun commented on Mar 15, 2019

    @AttilaTheFun
    AttilaTheFun
    on Mar 15, 2019
    Author
    More actions

    Yes the bar is visible. I overrode input accessory view and returned the bar, and overrode can become first responder and returned true. Once the controller is presented I can tap on the text view to activate it, but I can’t automatically focus it.

  3. tanujkumar1640 commented on Mar 25, 2019

    @tanujkumar1640
    tanujkumar1640
    on Mar 25, 2019
    More actions

    You can call messageInputBar.inputTextView.becomeFirstResponder() from viewDidAppear(_ animated: Bool).

  4. lordKaos11 commented on Jun 10, 2019

    @lordKaos11
    lordKaos11
    on Jun 10, 2019
    More actions

    hello

    what if bar is visible, I can type in it, but when send is pressed nothing happens

    extension ViewController: MessageInputBarDelegate {
    func messageInputBar(
    _ inputBar: MessageInputBar,
    didPressSendButtonWith text: String) {
    print("ldldldld")
    let newMessage = Message(
    member: member,
    text: text,
    messageId: UUID().uuidString)

        messages.append(newMessage)
        inputBar.inputTextView.text = ""
        messagesCollectionView.reloadData()
        messagesCollectionView.scrollToBottom(animated: true)
    }
    

    }

  5. zkhalapyan commented on Jun 6, 2020

    @zkhalapyan
    zkhalapyan
    on Jun 6, 2020
    More actions

    Seems like this does the trick on latest:

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        self.becomeFirstResponder()
        self.messageInputBar.inputTextView.becomeFirstResponder()
    }
    Reacted by Vanja Ruzic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.