Search code examples
iosswiftuiimageviewstoryboard

Why this image link not showing up in UIimageView in ios?


Why this image link not showing up in UIimageView in ios ?

var url = URL(string: "https://bill.ps/uploads/32065621a012e53f749c15b0a8468d71swift_file5486.png")

Code

func fetchImage(_ photoURL: URL?) { 
    guard let imageURL = photoURL else { return } 
    DispatchQueue.global(qos: .userInitiated).async { 
        do { 
            let imageData: Data = try Data(contentsOf: imageURL) 
            DispatchQueue.main.async { 
                let image = UIImage(data: imageData)
                print(image)
            } 
        } catch { 
            print("Unable to load data: (error)")
        } 
    } 
}

Image Link


Solution

  • I checked the issue with backend developer , its related to WAF header on api server .

    WAF block requests with missing in header.