ios - UICollectionView UIImageView images not appearing -


i'm having trouble getting images appear in uicollectionview. can see cells being created, , if set image manually through storyboard image appears, can't happen in code

the collection view uses custom cell, below

class cardslistcell: uicollectionviewcell {     @iboutlet weak var image: uiimageview!      override func awakefromnib() {         super.awakefromnib()     }  }] 

the image connected in storyboard , cell has correct class set

the code displaying image

override func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> cardslistcell {         let cell = collectionview.dequeuereusablecellwithreuseidentifier("cell", forindexpath: indexpath) cardslistcell          // configure cell          var card : card = self.fetchedresultscontroller.objectatindexpath(indexpath) card          var img = uiimage(named: card.image)         var imageview = uiimageview(image: img)          cell.image = imageview           return cell     } 

it looks image , image view being created can print them out


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -