I recently published an open source project that solves this problem. The Chat SDK is available under the MIT license on Github. The library has the following functions that may be useful:
BChatViewController.m
Speech message view with bubbles, similar to the Messages application. Here you can also see examples of how to handle keyboard shows and hide events to add an input text field on top of the keyboard.
BMessageCell.m
This is the main class of message bubbles. There are functions for dynamically flowering message bubbles ( +(UIImage *) bubbleWithImage: withColor:
and adding the tail of a speech bubble.
BMessageLayout.m
Useful utility functions for determining the height for a text area.
BTextInputView.m
This is a variable sized text input field that floats above the keyboard.
The user interface is very modular, which means you can easily add it to your application.
This library also supports Firebase , which means you wonβt need to create your own system to send messages using push notifications.
source share