Networking and Concurrency


Networking means making a network request. This is a request for data from online. Currently, the most common way to make a network request in Swift is to use NSURLSession and the classes associated with it. You can look up and find out more about NSURLSession in the documentation.

When you are making a network request, it is important that you only transfer as much data as is needed. This is because if you transfer more, it could take more time and if the user has a service provider that charges for the amount of data that they use you could cost them money (or at least cut into their amount for the month). Some other important things to remember are to allow the user to cancel the transfer or stop the process, avoid network timeouts, and if things fail or don’t go the best, make sure that your app can run as well as possible even in those situations.


Concurrency allows for multiple tasks to be handled at once in an app. This may seem like a no brainer, but there were a lot of hurdles to jump over to make it easy for so much to happen at one time. Concurrency is accomplished through threading and working asynchronously. Asynchronously means, that even if the app hadn’t finished what it needs to do, it can run in the background quietly and finish it’s job while everything else keeps working around it.

An important thing to know with concurrency is that you have multiple threads. These threads allow for different tasks to be running at the same time. The main thread is always used for the user interface. This is because the interface needs to be fast and responsive so that your app doesn’t seem slow or broken. This means that when you make a networking call you don’t want to do it on the main thread because it could bog it down.

This was a lot of kind of vague information so I hope this provides a surface level understanding of how networking and concurrency works.

This is a really nifty resource if you are looking for more information: