title: SDWebImage Set Image To UIButton in CellView Using Swift
body: <p>Hi I am using SDWebImage to set image to a button in xcode 10.2.1.</p>
  
  <p>I am trying the following</p>
  
  <pre><code>import SDWebImage
  
  cell.bProfileImage.sd_setImage(with:URL(string:
  individualChatsListArray[indexPath.row].profile_image), forState:.normal)
  </code></pre>
  
  <p>But I am getting the following error</p>
  
  <pre><code>Value of optional type 'UIButton?' must be unwrapped to refer to member
   'sd_setImage' of wrapped base type 'UIButton'
  </code></pre>
  
  <p>In the nib file the items are linked and declared as per below</p>
  
  <pre><code>@IBOutlet weak var bProfileImage: UIButton!
  
  
  @IBAction func bProfileImage(_ sender: Any) {
  
      print("touch kia")
  
  }
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>cell.bProfileImage?.sd_setImage(with:URL(string:
  individualChatsListArray[indexPath.row].profile_image), forState:.normal)
  </code></pre>
  
  <p>But then getting the following error</p>
  
  <pre><code>Ambiguous reference to member 'bProfileImage'
  </code></pre>
  
  <p>As you can see I am new to xcode/swift</p>
  
  <p>The following is not giving any error but is also not loading the image         </p>
  
  <pre><code>cell.bProfileImage.sd_setBackgroundImage(with: URL(string:
  individualChatsListArray[indexPath.row].profile_image), for:
  UIControl.State.normal) { (image, error, cache, url) in }
  </code></pre>