Initializer

init(base64Encoded:options:)

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

Declaration

init?(base64Encoded base64String: String, options: NSData.Base64DecodingOptions = [])

Parameters

base64String

A Base-64 encoded string.

options

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

Return Value

A data object built by Base-64 decoding the provided string. 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.

See Also

Base-64 Encoding

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

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

func base64EncodedData(options: NSData.Base64EncodingOptions = [])

Create a Base-64, UTF-8 encoded data object from the receiver's contents using the given options.

func base64EncodedString(options: NSData.Base64EncodingOptions = [])

Create a Base-64 encoded string from the receiver's contents using the given options.

struct NSData.Base64EncodingOptions

Options for methods used to Base-64 encode data.

struct NSData.Base64DecodingOptions

Options to modify the decoding algorithm used to decode Base-64 encoded data objects.

init?(base64Encoding: String)

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

Deprecated
func base64Encoding()

Create a Base-64 encoded string from the receiver's contents.

Deprecated