Alfian Losari 9/7/2019

Understanding Opaque Return Types in Swift

Read Original

This technical article details the opaque return types feature introduced in Swift 5.1. It explains how the 'some' keyword allows functions to return a specific type conforming to a protocol without exposing the concrete type, enhancing API encapsulation. The article contrasts this with using plain protocol types, discusses benefits like supporting protocols with associated types, and provides code examples for clarity.

Understanding Opaque Return Types in Swift

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser