Simple. I have two projects in Xcode. In one of them I made a .xib file and I want to copy it to another project, so as to save some time redoing it.
I can't drag it to the other project, nor do copy/paste by command, nor cop开发者_运维知识库y/paste by the Edit menu.
Any suggestions?
Go into finder, find the .xib file and copy it to the directory of the second project. Then uses add existing files to add it to the second project.
Just drag and drop from one project window to the other.
Make sure that you check the "Copy items to the destination folder"
If you have more than one targets make sure that you check the appropriate target when you add it.
You probably have to reconnect all of your outlets, and if it crashes for some reason it means that there are connected outlets/actions which are not available in your code.
Here is how I managed to do this with XCode 10.2.1
- Close the XCode project with the xib file you want to copy.
- Drag the xib file from finder over to the new project. Make sure you tick the copy items if needed box.
- If the xib file uses images for outlets, also drag the images to the new project.
There is no need to reconnect the outlets.
精彩评论