3

Is there a way to copy View Controller's element (views, labels, buttons and whatnots) to another ViewController but without copying the bindings set on this item (IBAction,IBOutlets)?

This is most obvious when you try to copy some views between projects, then you have in both projects connections and if you modify it in one it is reflected in other!

Lukasz 'Severiaan' Grela
  • 6,078
  • 7
  • 43
  • 79
  • Are those elements in storyboard or you are adding through codebase? – Mrunal Jun 26 '14 at 06:40
  • I though tag Interface-Builder will be a good hint, but I will update question - in other words in IB. – Lukasz 'Severiaan' Grela Jun 26 '14 at 06:41
  • You can load the same view in different view controller.In load view controller method assign view to the self.view – Saurav Nagpal Jun 26 '14 at 07:00
  • Last time I checked, only the IBActions are copied. But in any case, just keep the *Connections inspector* open, and delete the connections you don't want. In fact, after copying all the elements, select the view controller itself, and the *Connections inspector* will show all of the connections, making it easy to eradicate any strays. – user3386109 Jun 26 '14 at 07:14
  • Yes, that's how I'm doing it now:) but it is bit cumbersome when I want to copy loads of items at once. – Lukasz 'Severiaan' Grela Jun 26 '14 at 07:55

0 Answers0