title: swift 4 pickerview with images
body: <p>I am trying to get images to show up in the pickerview instead of text.
  I am seeing ? and no images. I know the images are correct as I am using them in another view. </p>
  
  <p>I tried to follow some other stack overflow posts but to no avail.
  like this one: <a href="https://stackoverflow.com/questions/27769246/how-can-i-get-images-to-appear-in-ui-pickerview-component-in-swift">How can I get images to appear in UI PickerView Component in Swift?</a></p>
  
  <p><a href="https://i.stack.imgur.com/KTyFB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KTyFB.png" alt="enter image description here"></a></p>
  
  <p>code:</p>
  
  <pre><code>import UIKit
  
  class ShuffleViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
  
  @IBOutlet weak var label: UILabel!
  
  @IBOutlet weak var shufflePicker: UIPickerView!
  var pickerData: [String] = [String]()
  
  let images = [UIImage(named:"Acceptance"),
                UIImage(named: "loveimage"),
                UIImage(named: "gratimage"),
                UIImage(named: "successsmall"),
                UIImage(named: "pos"),
                UIImage(named: "rel"),
                UIImage(named: "weal"),
                UIImage(named: "heal2"),
                UIImage(named: "confiden")]
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      shufflePicker.delegate = self
      shufflePicker.dataSource = self
  
  }
  
  func numberOfComponents(in shufflePicker: UIPickerView) -&gt; Int {
      return 1
  }
  
  
  func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
  
  }
  
  
  func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
  return 6
  }
  
  
  func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; UIImage? {
  
  return images[row]
  }
  </code></pre>
  
  <p>I'm no sure what to do as I am fairly new to Xcode and swift</p>