how to share common code between two projects in xcode swift

700 Views Asked by At

Hi We have an application that contains two modules (user and admin), Both share some common code related to a few features. As per requirement, we need to create two apps (user and admin), How can we share the code efficiently between two projects?

Thanks in advance.

1

There are 1 best solutions below

0
On

You have basically three ways if you're working on an iOS app :

  1. Apple's way: Frameworks.
  2. Making a CocoaPod. This is really convenient if you want to share the module, and can be easily integrated in XCode.
  3. Swift's way: Swift Package. In my opinion this slightly less convenient but is completely platform-agnostic, so you can reuse your code even on other platforms.