Contents

init(contentsOf:encoding:)

Returns an @c NSString object initialized by reading data from a given URL interpreted using a given encoding.

Declaration

convenience init(contentsOf url: URL, encoding enc: UInt) throws

Parameters

  • url:

    The URL to read.

  • enc:

    The encoding of the file at @c url.

Return Value

An @c NSString object initialized by reading data from @c url. Returns @c nil if the URL can’t be opened or there is an encoding error.