Swift 4 AlamofireImage with UITableView Cell

后端 未结 10 3121
梦如初夏
梦如初夏 2021-02-20 12:56

I am using AlamofireImages to try to download an image from a server and display it in my table view cell, this is what I got, but my images does not appear, just the textLabel

10条回答
  •  梦谈多话
    2021-02-20 13:48

    your code is correct. i think the transport security block your image over http . add this into your info.plist file

    NSAppTransportSecurity
    
        NSAllowsArbitraryLoads
        
        NSExceptionDomains
        
            example.com         //put your domain name here
            
                NSExceptionAllowsInsecureHTTPLoads
                
                NSIncludesSubdomains
                
            
        
    
    

    and you can also use the alamofire's image library. just add pod alamofireImage.

提交回复
热议问题