Instance Method

base64EncodedData(options:)

Creates a Base64, UTF-8 encoded data object from the string using the given options.

Declaration

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

Parameters

options

A mask that specifies options for Base64 encoding the data. Possible values are given in NSData.Base64EncodingOptions.

Return Value

A Base64, UTF-8 encoded data object.

Discussion

By default, no line endings are inserted.

If you specify one of the line length options (lineLength64Characters or lineLength76Characters) but don’t specify the kind of line ending to insert, the default line ending is Carriage Return + Line Feed.

See Also

Encoding and Decoding Base64 Representations

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

Initializes a data object with the given Base64 encoded data.

init?(base64Encoding: String)

Initializes a data object initialized with the given Base64 encoded string.

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

Initializes a data object with the given Base64 encoded string.

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

Creates a Base64 encoded string from the string using the given options.

func base64Encoding()

Initializes a Base64 encoded string from the string.

Deprecated
struct NSData.Base64EncodingOptions

Options for methods used to Base64 encode data.

struct NSData.Base64DecodingOptions

Options to modify the decoding algorithm used to decode Base64 encoded data.