<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Void",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s4Voida"
  },
  "title" : "Void"
}
-->

# Void

The return type of functions that don’t explicitly specify a return type,
that is, an empty tuple `()`.

```
typealias Void = ()
```

## 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.

```
// No return type declared:
func logMessage(_ s: String) {
    print("Message: \(s)")
}

let logger: (String) -> Void = logMessage
logger("This is a void function")
// Prints "Message: This is a void function"
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)