Geek Culture
Published in

Geek Culture

From verbose to concise

From Class to Enum: Creating a Haptic Feedback Generator in Swift 5

From heavy to lightweight

A hand touching a large digital display of some sort
Photo by Elia Pellegrini on Unsplash

Say you’re making a singleton or static class to represent data and/or logic that will never change. In many cases, you can convert this logic to an enum and save yourself a bunch of hassle. An enum has much of the functionality of a class, but…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store