This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AsyncFileReading { | |
func asyncReadFile(_ url: URL) async throws -> Data { | |
let (data, _) = try await URLSession.shared.data(from: url) | |
return data | |
} | |
static func testout() { | |
let instance = AsyncFileReading() | |
let filename = "file_to_be_read.txt" | |
let url = Bundle.main.bundleURL.appending(component: filename) |
OlderNewer