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.
Create a new iOS app project Select the Main storyboard from the file browser. Add a CollectionView by pressing command shift L to open the storyboard widget window. Drag the collectionView onto the main view controller.
The collection view presents items onscreen using a cell, which is an instance of the UICollectionViewCell class that your data source configures and provides. In addition to its cells, a collection view can present data using other types of views.
Overview. A flow layout is a type of collection view layout. Items in the collection view flow from one row or column (depending on the scrolling direction) to the next, with each row containing as many cells as will fit. Cells can be the same sizes or different sizes.
This is another stackoverflow link :
UICollectionView adding UICollectionCell
This is one Github project:
https://github.com/lequysang/TestCollectionViewWithXIB
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With