Country

public struct Country : Equatable

Country information.

Lifecycle

  • Creates an instance with the specified country code and country name.

    Throws

    If a code or name is empty, the InitializationError error thrown.

    Declaration

    Swift

    public init(
        code: String,
        name: String
    ) throws

    Parameters

    code

    ISO 3166-1 alpha-3 code of the country.

    name

    Country name.

Public

  • ISO 3166-1 alpha-3 code of the country.

    Guaranteed to be non-empty.

    Declaration

    Swift

    public let code: String
  • Country name.

    Guaranteed to be non-empty.

    Declaration

    Swift

    public let name: String

Country.InitializationError

  • An error that occurs during the creation of the instance.

    See more

    Declaration

    Swift

    public enum InitializationError : Error