In-Out Parameters In Swift Functions

It’s not hard to mutate original provided arguments in functions, it’s just risky sometimes!

Gabriel Theodoropoulos

--

Photo by Anthony Roberts on Unsplash

When coding in Swift, we usually don’t need to mutate the arguments that we provide to functions, and then make these changes visible back to the call site. We mostly use them as inputs to calculations or other expressions, and if necessary, we…

--

--

Gabriel Theodoropoulos

An iOS & macOS app maker writing code in Swift. Author of countless programming tutorials. Content creator. https://serialcoder.dev