Understanding Opaque Types in Swift and SwiftUI: The Power of `some`

If you have ever written a single line of SwiftUI, you have seen this code: var body: some View { Text("Hello, World!") } That tiny word—some—represents one of the most powerful and complex features introduced in modern Swift: Opaque Return Types. But what exactly does some do? Why can’t we just return View? And when should you use opaque types in your own non-UI Swift code? Let’s break down the what, why, where, and the common violations. ...

June 30, 2026 · 7 min