iOS

Create a Custom framework in iOS

Create Framework in Swift

follow these step to creating Custom Framework in Swift-IOS:

  1. Create a new project. In Xcode
  2. Choose iOS/Framework & Library/Cocoa Touch Framework to create a new framework
  3. click next and set the productName
  4. click next and choose directory to create Project there
  5. add code and resources to created project

Framework created successfully

to add created framework to another project, first you should create a workspace
add “target project” and “framework project” to workspace, then :

  1. go to the general tab of target project
  2. drag the “*.framework” file in product folder of framework project to “Embedded Binaries” section
  3. to use in any ViewController or class just import framework at each file

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow