Skip to content

InitializerSwift

init(contentsOfFile:usedEncoding:)

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
Produces a string created by reading data from the file at a given path and returns by reference the encoding used to interpret the file.
init(contentsOfFile path: String, usedEncoding: inout String.Encoding) throws