The Defer Statement in Swift

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.

What defer is all about

--

--

--

An iOS & macOS app maker writing code in Swift. Author of countless programming tutorials. Content creator. https://serialcoder.dev

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gabriel Theodoropoulos

Gabriel Theodoropoulos

An iOS & macOS app maker writing code in Swift. Author of countless programming tutorials. Content creator. https://serialcoder.dev

More from Medium

Flavors of SwiftUI Picker on macOS

SwiftUI Tutorial — How to use a ProgressView with URLSession

WebView in SwiftUI

SwiftUI — Font templates made easy