Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionVIew without using the storyboard?

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.

like image 732
user2365995 Avatar asked May 25 '13 06:05

user2365995


People also ask

How to create UICollectionView in Swift Storyboard?

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.

How does UICollectionView work?

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.

What is UICollectionView flow layout?

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.


2 Answers

This is another stackoverflow link :

UICollectionView adding UICollectionCell

This is one Github project:

https://github.com/lequysang/TestCollectionViewWithXIB

like image 98
Priyank Gandhi Avatar answered Oct 13 '22 18:10

Priyank Gandhi


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!

like image 37
Michael Dautermann Avatar answered Oct 13 '22 18:10

Michael Dautermann