7

I read through these tutorials on UICollectionView:

http://blogs.captechconsulting.com/blog/paul-dakessian/ios-6-tutorial-getting-started-collection-views

http://invasivecode.tumblr.com/post/34581461219/an-introduction-to-collection-views.

I know it's easy to use the CollectionView in storyboard, but I want to use the UICollectionView with a xib instead of a storyboard.

Thanks in advance.

Josh Durham
  • 1,572
  • 1
  • 16
  • 27
user2365995
  • 87
  • 1
  • 4
  • So... do you want to create one in code or do you want to create one in a XIB? – Stavash May 25 '13 at 06:47
  • 1
    What's your question? What exactly are you having an issue with? – rmaddy May 25 '13 at 06:48
  • yes i want to add the uicollectionview in my xib – user2365995 May 25 '13 at 06:49
  • @rmaddy i want to use the uicollectionview like UIVIew -> UIcollectionview ->uicollectionview cell then after i want to add image in uicollectionview cell but i can not add image in uicollectionview cell – user2365995 May 25 '13 at 06:51
  • 1
    This might help you https://github.com/lequysang/TestCollectionViewWithXIB This is a another stack link :http://stackoverflow.com/questions/15184968/uicollectionview-adding-uicollectioncell – Impossible May 25 '13 at 06:53
  • Can you include some code? How far are you getting? Is the problem just in populating the cells, or do you not even see cells? – jrturton May 25 '13 at 06:53
  • @Impossible thanks my problem is solved – user2365995 May 25 '13 at 07:00

2 Answers2

11

This is another stackoverflow link :

UICollectionView adding UICollectionCell

This is one Github project:

https://github.com/lequysang/TestCollectionViewWithXIB

Community
  • 1
  • 1
Impossible
  • 1,237
  • 1
  • 16
  • 28
5

A XIB file usually contains exactly one view controller (and many objects as part of that view controller).

And a storyboard is (for all intents and purposes) essentially a collection of XIB files all strung together by segues, so you can follow the flow.

What you really want to do here is simply substitute the word "XIB" for the word "Storyboard" in pretty much any tutorial you're looking at, keeping in mind that without a storyboard, you won't be using segues to get from view controller to the next view controller.

And here's a UICollectionView tutorial that you can refer to, which happens to talk about xib files, to boot. I hope this info helps you out!

Michael Dautermann
  • 86,557
  • 17
  • 155
  • 196