1

Just getting started with iOS, and trying to make the collection view on the right be a child view of the view on the left. I cant seem to drag it in. I think part of the problem is that on the left hand part of the nav (immediate left of the work area) the collection view is being called a scene. To create the view into which I want to put the collection view, I just dragged a new view controller into the work area, then did the control+click to add it to the main tab view. I am going to want another view above the collection view, but first things first...

Do I have to do this programmatically?

enter image description here

hvgotcodes
  • 118,147
  • 33
  • 203
  • 236
  • 2
    Drag a collectionView(white color in Utility panel), not a CollectionViewController. – LE SANG Jan 12 '13 at 02:58
  • @LêQuýSang is this an acceptable way to do it? – hvgotcodes Jan 12 '13 at 03:17
  • I get it i think, so instead of having its own controller, I'm effectively making the parent view's controller act as the collection views controller, to handle all its event, data manipulation, etc? If you make your comments an answer, I'll accept it. – hvgotcodes Jan 12 '13 at 03:23

1 Answers1

2

UICollectionView inherent from UIScrollView:UIView, so you can add in your IB or in code:

Like tableView, drag delegate and datasource to ViewController.If you want more collectiotionView, create more flowlayouts.

LE SANG
  • 10,955
  • 7
  • 59
  • 78
  • As soon as I do that my app crashes ('NSInvalidArgumentException', reason: '-[xxx.MainViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x7ffa91d146d0') – Underfrog Oct 06 '16 at 02:41