In which file can I define a typealias that works in the whole project, etc.
typealias S = String
In which file can I define a typealias that works in the whole project, etc.
typealias S = String
the typealias
works the same way as variables. If you want to be global put it outside the class scope at any file.
typealias
is use to aliasing the existing Data Types. Its access scope is same as a variable, if its declared in side the block like class, struct, protocol etc then its visibility also remains inside that block only. it can not be used outside to declare a new variables of that type.
© 2022 - 2024 — McMap. All rights reserved.