Disclaimer: I am new to Swift and IOS in general, so please keep that in mind!
While attempting to connect to an API, I am receiving the following error:
nw_protocol_get_quic_image_block_invoke dlopen libquic failed
.
Please find below the code used:
@State public var data = PoemData(title: String("Poem Name"), content: String("Poem Content"), poetData: PoetData(name: "Poet Name"))
func getData() {
let urlstring = "https://www.poemist.com/api/v1/randompoems"
let url = URL(string: urlstring)
URLSession.shared.dataTask(with: url!) {data, _, error in
DispatchQueue.main.async {
if let data = data {
do {
let decoder = JSONDecoder()
let decodedData = try decoder.decode(PoemData.self, from: data)
self.data = decodedData
} catch {
print ("Error! Something went wrong, yikes")
}
}
}
}.resume()
}
And the data model:
import Foundation
struct PoemData: Decodable {
public var title: String
public var content: String
public var poetData: PoetData
}
struct PoetData: Decodable {
var name: String
}
Any ideas?
This is purely a Simulator message. It won't happen on a device, and it doesn't affect the behavior of your app, so just ignore it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With