简体   繁体   中英

Copy view controller from one project to another

I am working on project X. I needed to add component Y to the project. So I go and create component Y as a separate project, say Project W. Now I need to copy Project W into Project X as component Y. How do I do that? I don't mind copying one piece at a time such as: copy ViewControllers in storyboard manually, and then copy the classes manually. Thanks for any help.

Go to the ViewController or storyboard object, select the top bar so you're selecting the whole thing, and then hit COMMAND + C to copy.

Then go to your other project, and open up Storyboard, and place your cursor down onto the open field, and hit COMMAND + V to paste it.

Typically you then have to zoom out on storyboard scene to see it, as for some reason it'll place it down all cattywampus. However, you'll see the files appear in your list of scenes (middle or left panel).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM