Unexpected Non Void return value in CollectionView cellForItemAtIndexPath Datasource method
<pre><code>override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
    if let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as? PictureCellForHomeVC {
        picArray[indexPath.row].getDataInBackgroundWithBlock({ (data: NSData?, error: NSError?) in
            if error == nil {
                if let data = data {
                    let image = UIImage(data: data)
                    cell.imageView.image = image
                    return cell
                }
            }
        })
    }else {
        return UICollectionViewCell()
    }
}
</code></pre>

<p>In the above code I receive the error:</p>

<p><code>Unexpected Non Void return value in void function</code></p>

<p>The <code>picArray</code> in my above code is code with <code>PFFile</code> objects which I can call the <code>getDataInBackgroundWithBlock</code> method.</p>

<p>I understand what the error means since the completionHandler of the <code>getDataInBackgroundWithBlock</code> returns <code>void</code> so I can't return my cell in it, but I am stuck on how to fix this problem.</p>

<p>I can't even pass a seperate closure to the method <code>cellForItemAtIndexPath</code> since I do not call the method and it is a datasource method. Does anyone know how I can fix this issue?</p>