Optional unwrapping syntax in Swift 5.7

Gurjit Singh
2 min readJun 15, 2022
Photo by Danial Igdery on Unsplash

Optional unwrapping is one of the most used patterns in iOS development. Swift 5.7 introduces new features included a new way to unwrap optional values using if let and guard let statements. It eliminates duplication to make writing and reading code easier. Previously, we unwrapped optional values in the following manner:

var someVariable: String?

if let someVariable = someVariable {

}

--

--

Gurjit Singh

I’m Computer Science graduate and an iOS Engineer who writes about Swift and iOS development. Follow me on twitter @gurjitpt and for more articles www.gurjit.co