Abusing Swift’s Result Type

A tale about when the Result type shouldn’t be used.

Nikita Lazarev-Zubov

--

Abusing Swift’s Result Type
Photo by Mike Kilcoyne on Unsplash

When the Result type was added to Swift’s standard library a few years ago, this simple change affected how we treat completion-based asynchronous methods enormously. Judge for yourself: Clumsy and ambiguous completion handlers like this sank into oblivion:

func getData(_ completionHandler: (_ data…

--

--

Nikita Lazarev-Zubov

Swift and general programming topics, Agile software development, soft skills