What is the best way to copy xib file (s)?

I have a ViewController.xib that I would like to duplicate, so I can make some changes to duplicate copies. Everything is laid out as I like in the Builder interface and correctly encoded in the original ViewController (.M and h.). Can this be done and what is the best way to do this?

+4
source share
2 answers

Unfortunately, there is no way to directly duplicate a file from Xcode. I sent an error to Apple, and you need one too. This is not too difficult to do manually:

  • In Xcode, right-click on xib and select "Show in Finder"
  • Once Finder selects the selected file, right-click on it and select "Duplicate"
  • Rename the file as you need.
  • Drag these new files back into your Xcode project.
+11
source

Using FINDER, duplicate all three files and rename them.

Drag them back to the project in Xcode.

Rename the class in the .h and .m files and start making your subtle changes.

However, if your changes are only related to positioning, you can just use one file and change the frames of the things you are moving

OR

Just duplicate the XIB file, rename it accordingly, add to the project and make subtle changes. You can then download the ViewController depending on which XIB suits your needs ...

0
source

All Articles