Protocol

ExpressibleByNilLiteral

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

Declaration

protocol ExpressibleByNilLiteral

Overview

nil has a specific meaning in Swift—the absence of a value. Only the Optional type conforms to ExpressibleByNilLiteral. ExpressibleByNilLiteral conformance for types that use nil for other purposes is discouraged.

Topics

Initializers

init(nilLiteral: ())

Creates an instance initialized with nil.

Required.

Relationships

Conforming Types

See Also

Value Literals

protocol ExpressibleByIntegerLiteral

A type that can be initialized with an integer literal.

protocol ExpressibleByFloatLiteral

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

protocol ExpressibleByBooleanLiteral

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