-1

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!)
//              
Mahesh Giri
  • 1,810
  • 19
  • 27

2 Answers2

3

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"])
Gene Z. Ragan
  • 2,643
  • 2
  • 31
  • 41
Mahesh Giri
  • 1,810
  • 19
  • 27
  • 1
    Hi... where did you add this exactly.. please help me. I have an api with request in which I am getting .jpg image. which is not supported by AlamofireImage. How did you do it? – Bella Apr 25 '18 at 08:04
  • 1
    before getting image – Mahesh Giri May 14 '18 at 06:32
0

I had the case that images stopped downloading, after this setting was added to the info.plist file (on advise of a third party ad implementation);

NSAllowsArbitraryLoadsForMedia

Removing it fixed the issue.

7RedBits.com
  • 454
  • 6
  • 6