The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
SDK
- Xcode 6.0.1+
Framework
- Swift Standard Library
Declaration
Discussion
When declaring a function or method, you don’t need to specify a return type if no value will be returned. However, the type of a function, method, or closure always includes a return type, which is Void
if otherwise unspecified.
Use Void
or an empty tuple as the return type when declaring a closure, function, or method that doesn’t return a value.