Member-only story

Avoid Long Parameter Lists in Swift

Real-life Problems == Solved

Steven Curtis
5 min readMay 5, 2021
Photo by Etienne Boulanger on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 12.5, and Swift 5.4

If you’re interested, or you prefer here is a YouTube video on the same topic:

Prerequisites:

Keywords and Terminology

Initialization: The process of preparing an instance of a class, structure, or enumeration for use

Parameter: A special kind of variable referring to a piece of data passed to a function

The high-level stuff

The problem

You might be a most excellent coder and separate out your UI code from your business logic. You might then notice that some of your business logic classes have rather long parameter lists, and you might have heard that having more than…

--

--

No responses yet