uchicago-mobi / MPCS51030-2017-Winter-Forum

7 stars 0 forks source link

All Images not loading #146

Closed turabhassan89 closed 7 years ago

turabhassan89 commented 7 years ago

Hi,

Only my first image loads and the rest are blanks. The cells are cerated but they fail to populate.

Also I have my activity indicator in place but it also doesn't show up.

I have pushed my code if someone can take a look at it, thanks.

hbennett766 commented 7 years ago

Your images are loading and populating with images just fine. The way you're laying out the imageView frames is causing them to be outside the visible section of each cell. The best way to set up your collection view cells would be to add an image view to the prototype cell in storyboard, hook it up an IB outlet in the custom imageCollectionViewCell you created, cast your collectionView cellForRowAtIndexPath cell as an imageCollectionViewCell, and then just set the image property of the cell to equal "image", the object you get back from network call.

Here's a few tutorials that take you through those steps: http://www.apptuitions.com/uitableview-with-custom-cell-in-swift/ http://www.seemuapps.com/tutorial-custom-uitableview-cell

hbennett766 commented 7 years ago

On the subject of your activity indicator not showing up, I've got a hunch #148 may be the problem.