<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/initialization-with-literals",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Initialization with Literals"
}
-->

# Initialization with Literals

Allow values of your type to be expressed using different kinds of literals.

## Topics

### Collection Literals

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

A type that can be initialized using an array literal.

[`ExpressibleByDictionaryLiteral`](/documentation/Swift/ExpressibleByDictionaryLiteral)

A type that can be initialized using a dictionary literal.

### Value Literals

[`ExpressibleByIntegerLiteral`](/documentation/Swift/ExpressibleByIntegerLiteral)

A type that can be initialized with an integer literal.

[`ExpressibleByFloatLiteral`](/documentation/Swift/ExpressibleByFloatLiteral)

A type that can be initialized with a floating-point literal.

[`ExpressibleByBooleanLiteral`](/documentation/Swift/ExpressibleByBooleanLiteral)

A type that can be initialized with the Boolean literals `true` and
`false`.

[`ExpressibleByNilLiteral`](/documentation/Swift/ExpressibleByNilLiteral)

A type that can be initialized using the nil literal, `nil`.

[`StaticBigInt`](/documentation/Swift/StaticBigInt)

An immutable arbitrary-precision signed integer.

### String Literals

[`ExpressibleByStringLiteral`](/documentation/Swift/ExpressibleByStringLiteral)

A type that can be initialized with a string literal.

[`ExpressibleByExtendedGraphemeClusterLiteral`](/documentation/Swift/ExpressibleByExtendedGraphemeClusterLiteral)

A type that can be initialized with a string literal containing a single
extended grapheme cluster.

[`ExpressibleByUnicodeScalarLiteral`](/documentation/Swift/ExpressibleByUnicodeScalarLiteral)

A type that can be initialized with a string literal containing a single
Unicode scalar value.

[`ExpressibleByStringInterpolation`](/documentation/Swift/ExpressibleByStringInterpolation)

A type that can be initialized by string interpolation with a string
literal that includes expressions.

[`StringInterpolationProtocol`](/documentation/Swift/StringInterpolationProtocol)

Represents the contents of a string literal with interpolations while it’s
being built up.

[`DefaultStringInterpolation`](/documentation/Swift/DefaultStringInterpolation)

Represents a string literal with interpolations while it’s being built up.

### Default Types for Literals

  <doc://com.apple.Swift/documentation/Swift/default-literal-types>



---

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)