Search code examples
swiftjsqmessagesviewcontroller

Replace JSQMessages input toolbar with yes/no buttons


I am using JSQMessages to build a chat-UI based app that talks to a web service. However, I don't want the user to be able to respond with open-ended texts but rather a pre-set number of replies such as "yes" and "no" and "maybe".

How do I override the input toolbar with something like a UIStackView of close-ended text buttons (open to another UI option, too)?

I would prefer not to muck up the source code for the library if possible.

Thank you.


Solution

  • I ended up using the handy property on inputtoolbar:

         self.inputToolbar.isHidden = true
    

    And then I just added some buttons programmatically.