WWDC 2018 Latest Swift 4.2 Features
Less boilerplate = happier developers
As an iOS developer, I started with Objective-C as many of our kind do. In my day-to-day, I work with Swift, and considering its growth from its first iteration, I find its versatility very promising. Yes, the breaking changes of the first few versions were painful to work with; however, these growing pains have resulted in a better, and more efficient language. Its 4th major version continues to impress in both features and community.
Last week, Apple held its annual Worldwide Developer Conference (WWDC), which showcased some of the latest improvements to Swift. While Swift 5 is set to be released in 2019, Swift 4.2 offers its own advantages, specifically towards the removal of tedious boilerplate code.
Derived Collection of Enum Cases
One of the lovely features of Swift is its ability to extend enums with struct-like functionality. For example, if we want to iterate through all of the Fruits in the enum displayed below, we need to implement some boilerplate code that contains all of the cases in an array.