-3

In application,I want to add collection view in xib and want to reuse it in different controllers.I tried but xib did not allowed to add collection view it only add cells..??

1 Answers1

0

In most of the cases it is a challangeing task to make a ViewController reusable since different ViewControllers have to interact with different views which may have different behaviour, we mainly focus on making views reusable using xib as much as possible. So the conclusion is it is preferred to use xib file for reusable cells not for ViewControllers just to reuse here and there. What you can do is use xib file for viewcontrollers instead of keeping refernce in storyboard.

laxman khanal
  • 998
  • 1
  • 8
  • 18
  • u r right...but in our case it is not possible to add 15-20 collection views on each page..it must be quite lengthy process to add each collection view everytime – Rutuja Pawal Sep 12 '17 at 07:54