From verbose to concise

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

From heavy to lightweight

Kenny Dubroff
Geek Culture
Published in
6 min readJul 4, 2021

--

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…

--

--

Kenny Dubroff
Geek Culture

I’m a Full Stack iOS Developer with a passion for writing clean, reusable code.