简体   繁体   中英

How to use one Xcode project into another Xcode project in iOS?

I want to add one Xcode project to another Xcode project.

For example currently I have Test1.xcodeproj and this project have .h and .m files. It also includes images/assets or storyboard files.

I again created new Test2.xcodeproj and I also want to import Test1 files to my Test2 project.

What is the best solution to solve this issue?

Can I create static library or framework for Test1.xcodeproj ?

How to access Test1 files to Test2 project?

Any help or direction would be appreciated. Thanks!

if you need classes and storyboard or xibs etc then you can open your files in finder and then can copy and paste in your another project! and you can access it as you have created that classes in that project. It is as like you drag and drop third party library in your project. Library are nothing but bunch of classes.

If you have storyboard and xib also then you need to manage some things like, you have to use multiple storyboard if you have another storyboard in current project.

If you want to include assets and storyboards you'll need to create a Cocoa Touch Framework. Go to File->New->Project and select Cocoa Touch Framework. Add all your Test1 files to this project. Add the framework project Test1 to your Test2 project. You can do this via File->Add File To...

To get the code to link with Test2 you will need to add it as an embedded binary. Go to the general tab of the project settings and scroll down to the bottom. Click on the plus sign in the embedded binaries section and choose the Test1 project. This will also add Test1 to your linked frameworks and libraries and the target dependencies of the project.

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