init(rawValue:)

Creates a new instance of the enum from the given raw integer value.

Enum.swift:32
init?(rawValue: Int)

Parameters

rawValue

The raw integer value from which to create the enum value.

For proto2 enums, this initializer will fail if the raw value does not correspond to a valid enum value. For proto3 enums, this initializer never fails; unknown values are created as instances of the UNRECOGNIZED case.