How to create UICollectionView without using the storyboard?

后端 未结 2 1412
一个人的身影
一个人的身影 2021-01-01 03:12

I have found some nice tutorials of UIcollectionview over the net

http://www.raywenderlich.com/22324/beginning-uicollectionview-in-ios-6-part-12

http://ashf

相关标签:
2条回答
  • 2021-01-01 03:40

    Yes. It can be done either way. please refer to following examples.

    UPDATE: This(1st) example is more suitable for the question.. http://adoptioncurve.net/archives/2012/09/a-simple-uicollectionview-tutorial/

    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 am not very sure but there shouldn't be any pros and cons for using storyboards apart from its easy to implement.

    0 讨论(0)
  • 2021-01-01 04:00

    In fact it is very easy with the story board. From the tutorials above you can see how to setup the story board. Once you do that you need to go again to the story board, select the cell in the collection view and then in the right sight bar in the identity inspector (the 3rd inspector) type in your sub class of view cell. Afterwards go to the attributes inspector (the 4th inspector). There right on the top is a field "Collection Reusable View" - Identifier. Type in your reusable identifier string, the same one that you will give to dequeueReusableCellWithReuseIdentifier.

    That's all. Once you do it, you will see that it is super simple.

    0 讨论(0)
提交回复
热议问题