Create Framework in Swift

suggest change

Follow these steps to create a custom framework in Swift for iOS:

  1. In Xcode, create a new project.
  2. Choose iOS > Framework & Library > Cocoa Touch Framework.
  3. Click Next and set the product name.
  4. Click Next and choose the directory for the project.
  5. Add code and resources to the framework project.

To use that framework from another app, create a workspace and add both the app project and the framework project. Then:

  1. Open the General tab of the app target.
  2. Drag the .framework product from the framework project into Embedded Binaries. In later Xcode versions that section is named Frameworks, Libraries, and Embedded Content. Choose Embed & Sign.
  3. In each Swift file that uses the framework, add import FrameworkName, using the framework’s module name.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents