One of my favorite mobile applications on iOS is Slack. So many of my daily conversations happen inside of this well-designed chat application. They get so many of the little details right such as the ability to swipe down or tap to dismiss the keyboard. There’s a level of polish in the application that is missing in many apps. So, when I started building things with Twilio IP Messaging I really wanted to replicate the things that they do so well. It quickly turned into a struggle as I fought Auto Layout and UITableViews. I went to the Internet for help and that’s when I found SlackTextViewController. All of the features I love about Slack’s message view are available as an easy to use control.

In this post we’ll pick up where the Swift iOS Quickstart leaves off and enhance it with the feature-packed SlackTextViewController. Along the way we’ll learn how to light up more of Twilio IP Messaging’s features such as typing indication and channel history. We’ll also take a look at how to use Auto Layout to design the view for an individual message such that it automatically resizes.

Before we get started you’ll need to work through the Swift iOS Quickstart since we’ll be using that as our starting point. I’ll wait here patiently while you build that…

Great, you’re back! Here’s what we will be building in this post:

The big improvements are keyboard management, typing indicator and the built in send button. These are all provided by SlackTextController. Let’s get started.

Gearing Up

Now that you’ve gone through the Quickstart, let’s recap what you have already:

IP Messaging service set up through Twilio

Backend application for obtaining tokens

Swift iOS application that authenticates a user with the IP Messaging Service using a random name and joins a chat channel named ‘general’