How to add a framework into iOS project
1 min readDec 26, 2023
Sharing some steps to create a new framework in Xcode and add it in a separate iOS project
- Create a new Xcode project, select framework, name it (say, MyFramework) and save it somewhere (say, on desktop)
- Create a new Xcode project select the iOS application name is (say, MyApplication) where we will add this framework
- 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)
- 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
- 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
- Import MyFramework anywhere in your project and use the framework accessible classes wherever you want to use. Woohoo!