Skip to content

Instantly share code, notes, and snippets.

View antonio081014's full-sized avatar
💭
Learning SwiftUI

Yi D. antonio081014

💭
Learning SwiftUI
View GitHub Profile
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)