The Defer Statement in Swift
3 min readNov 12, 2021
There are a few small things in Swift that can make a developer’s life much easier, and the coding process more efficient. One of them is the defer statement, which usually leads to writing shorter and simpler code when used. Before getting to know how to use defer, it’s necessary initially to understand its purpose. So, let’s get started with that.