Initializer

init(base64Encoded:options:)

Returns a data object initialized with the given Base-64 encoded data.

Declaration

init?(base64Encoded base64Data: Data, options: NSData.Base64DecodingOptions = [])

Parameters

base64Data

A Base-64, UTF-8 encoded data object.

options

A mask that specifies options for Base-64 decoding the data. Possible values are given in NSData.Base64DecodingOptions.

Return Value

A data object containing the Base-64 decoded data. Returns nil if the data object could not be decoded.

Discussion

The default implementation of this method will reject non-alphabet characters, including line break characters. To support different encodings and ignore non-alphabet characters, specify an options value of ignoreUnknownCharacters.