Sep 8, 2018 · 1 min read
Great article Max, I like the idea of using typealiases in a broader range of applications to make code more readable.
Just a thought: Have you noticed that function calls can’t be assigned to typealiases (only function signatures can)? The compiler rejects a function call assigned to a typealias as it states that it is an undeclared type:
func someFunction() {…}
typealias someTypealias = someFunction() // Use of undeclared type “someTypealias”
Functions are first class citizens in Swift and themselves are types defined by their signatures…
Would be interested to hear your thoughts on this
