WebSockets are a powerful protocol for real-time event based communication. Socket.io makes working with WebSockets easier on iOS with Swift compared to implementing all the underlying bits yourself.

Let’s demonstrate how to work with the Swift Socket.io client library by building an application to monitor the status of Twilio phone calls. This application will be similar to the application built in another tutorial for getting started with Socket.io on the web with JavaScript.

The tools we’ll need

Node.js and npm version 4.0 or greater installed on your machine for our web server

Xcode 8.0 or greater and Swift 3.0 or greater

To find out which version of swift you’re running, enter the following command in your terminal: