Connecting IOS socket client to a Ruby socket server using Swift & Ruby’s eventmachine gem.

To demonstrate, I have written a server that has one task. It reads a word and sends it back to the client in a reversed form.

The server code in few lines ;/

The client, which is written as a part of an IOS application in Swift;

The demo application that I wrote is a single view-based IOS-application, with 1 textfield, label and button.

An instance of ReverseClient is created in the ViewController…

And when the button is pressed;

Do not forget to start the server!