# Structures

The following structures are available globally.

- `AnyCodable`

  A type-erased `Codable` value.

  The `AnyCodable` type forwards encoding and decoding responsibilities to an underlying value, hiding its specific underlying type.

  You can encode or decode mixed-type values in dictionaries and other collections that require `Encodable` or `Decodable` conformance by declaring their contained type to be `AnyCodable`.

  See also

  `AnyEncodable`

  See also

  `AnyDecodable`
  See more

  #### Declaration

  Swift

      @frozen
      struct AnyCodable

      extension AnyCodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Escapable, ExpressibleByArrayLiteral, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, ExpressibleByNilLiteral, ExpressibleByStringInterpolation, ExpressibleByStringLiteral, ExpressibleByUnicodeScalarLiteral, Hashable, Sendable, SendableMetatype, _AnyDecodable, _AnyEncodable

- `AnyDecodable`

  A type-erased `Decodable` value.

  The `AnyDecodable` type forwards decoding responsibilities to an underlying value, hiding its specific underlying type.

  You can decode mixed-type values in dictionaries and other collections that require `Decodable` conformance by declaring their contained type to be `AnyDecodable`:

      let json = """
      {
          "boolean": true,
          "integer": 42,
          "double": 3.141592653589793,
          "string": "string",
          "array": [1, 2, 3],
          "nested": {
              "a": "alpha",
              "b": "bravo",
              "c": "charlie"
          },
          "null": null
      }
      """.data(using: .utf8)!

      let decoder = JSONDecoder()
      let dictionary = try! decoder.decode([String: AnyDecodable].self, from: json)

  See more

  #### Declaration

  Swift

      @frozen
      struct AnyDecodable

      extension AnyDecodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Equatable, Escapable, Hashable, _AnyDecodable

- `AnyEncodable`

  A type-erased `Encodable` value.

  The `AnyEncodable` type forwards encoding responsibilities to an underlying value, hiding its specific underlying type.

  You can encode mixed-type values in dictionaries and other collections that require `Encodable` conformance by declaring their contained type to be `AnyEncodable`:

      let dictionary: [String: AnyEncodable] = [
          "boolean": true,
          "integer": 42,
          "double": 3.141592653589793,
          "string": "string",
          "array": [1, 2, 3],
          "nested": [
              "a": "alpha",
              "b": "bravo",
              "c": "charlie"
          ],
          "null": nil
      ]

      let encoder = JSONEncoder()
      let json = try! encoder.encode(dictionary)

  See more

  #### Declaration

  Swift

      @frozen
      struct AnyEncodable

      extension AnyEncodable : Copyable, CustomDebugStringConvertible, CustomStringConvertible, Encodable, Equatable, Escapable, ExpressibleByArrayLiteral, ExpressibleByBooleanLiteral, ExpressibleByDictionaryLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByFloatLiteral, ExpressibleByIntegerLiteral, ExpressibleByNilLiteral, ExpressibleByStringInterpolation, ExpressibleByStringLiteral, ExpressibleByUnicodeScalarLiteral, Hashable, _AnyEncodable

- `LSError`

  LicenseSpring error.

  See more

  #### Declaration

  Swift

      struct LSError

      extension LSError : Copyable, CustomNSError, Error, Escapable, Sendable, SendableMetatype

© 2025 LicenseSpring. All rights reserved. (Last updated: 2025-10-22)

Generated by jazzy ♪♫ v0.15.3, a Realm project.