Server Side Swift: basic Client-Server communication example for iOS and Android
This is a repost of a Q&A pair I wrote on Stack Overflow.
Learning a new technology is a time consuming process. It was for Android with Java. And it was again for iOS with Swift. I’m now faced with the challenge of needing to provide a server backend for both Android and iOS apps. However, I would like to avoid the large time investment of learning a new language if possible. From what I have heard, the server code could be written in either Java or Swift, but Swift seems to be to be a much cleaner language so that is why I have chosen to go this route.
I want to make a proof-of-concept example where a server running Swift is able to communicate with an Android and iOS app. The apps send a request and receive a response.
The content below is my introduction into Server Side Swift.
A basic example involves three things:
- A Linux server running Swift
- An Android app
- An iOS app
The focus of this answer is on the Swift server.
Linux server running Swift
These directions are based on unit one of the free Udacity course titled Server-Side Swift. I recommend taking the…