iosswiftalamofireimage

Some times alamofireImage did't load images


I tried this using normal

 winnerCell.challengeBannerURL.af_setImage(withURL:  URL(string: winnerchallengesData[indexPath.row].challengeDetails.challenge_banner_url)!)

It was working in normal call but not in AlamofireImage

let data = try? Data(contentsOf: URL(string: self.winnerchallengesData[indexPath.row].winnerDetails.profileURL)!)
//                winnerCell.userProfile.image = UIImage(data:data!)
//              

Solution

  • The data coming from the server is a stream so I have to configure this in AlamofireImage.

    ImageResponseSerializer.addAcceptableImageContentTypes(["image/jpg","image/png","binary/octet-stream"])