Chapter 7. Everything is Connected – Memory Management
When using an app, nothing is worse than an app that is slow and unresponsive. Computer users have come to expect that every piece of software must respond immediately to every interaction. Even the most feature-rich app will be ruined if it is unpleasant to use because it doesn't manage the devices resources effectively. Also, with the growing popularity of mobile computers and devices, it is more important than ever to write software that efficiently uses battery power. One of the aspects of writing software that has the largest impact on both responsiveness and battery power is memory management.
In this chapter, we will discuss techniques specific to Swift that allow us to manage memory in order to ensure that our code remains responsive and minimize its effect on battery life. We will do so by covering the following topics:
- How data is stored on a computer
- Value types versus reference types
- Automatic reference...