Gio Lodi 7/18/2016

Swift Either enum

Read Original

This article details the Swift Either enum, a generic type representing a value that can be one of two distinct types. It explains its definition, compares it to Optional, and provides a practical use case for elegantly managing mixed data (like regular cells and advertisement banners) in UITableView or UICollectionView data sources, improving code clarity and type safety.

Swift Either enum

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser