Using imageUrl pointing to a generic https: .... .jpg file here is an example code which fails in current 14.5 simulator (it actually never returns w/ data or error code but sometimes times out on console) but works in 14.4 simulator. A lot of things should be broken in 14.5 if low level functionality like this fails.
URLSession.shared.dataTask(with: imageUrl as URL) { data, response, error in
DispatchQueue.main.async {
if let data = data {
if let image = UIImage(data: data as Data) {
}
}
}
}.resume()
or -
let downloadQueue = DispatchQueue(label: "fab.image", attributes: .concurrent)
downloadQueue.async() {
let data = NSData(contentsOf: imageUrl as URL)
if data != nil {
if let image = UIImage(data: data! as Data) {
}
}
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: