How to add a framework into iOS project

Sheikhamais
1 min readDec 26, 2023

--

Sharing some steps to create a new framework in Xcode and add it in a separate iOS project

  1. Create a new Xcode project, select framework, name it (say, MyFramework) and save it somewhere (say, on desktop)
  2. Create a new Xcode project select the iOS application name is (say, MyApplication) where we will add this framework
  3. Now take the MyFramework project folder and put it in the directory of MyApplication (This step because Xcode keeping a reference even when selection copy files)
  4. Now go to MyApplication and add files from the + button in the bottom left, from here go to the MyFramework folder and select MyFramework.xcodeproj file, now you can see a new project that is added as the framework
  5. Goto build phases in you MyApplication target and in Link Binary With Libraries hit the + button and select MyFramework to link your framework with MyApplication
  6. Import MyFramework anywhere in your project and use the framework accessible classes wherever you want to use. Woohoo!

--

--

Sheikhamais
Sheikhamais

No responses yet