How can I create a Framework for iOS, using Xcode 5? I previously used (before Xcode 5) a GitHub project that let me create a Fake Framework. In Xcode 5 it seems that it doesn't work anymore. Any suggestions?
UPDATE: To be clear I'm adding static libraries/frameworks to my framework project AND I want them linked into the produced framework. So I cannot just use the static library template.
In the app, select the project from the project navigator, select the Stocktance target, and scroll to Frameworks, Libraries, and Embedded Content. Click on the plus button, click Add Other… and select Add Files… Navigate to the SettingsKit folder and select it. We've added the framework to the project.
In Xcode, select File ▸ New ▸ Project…. Then choose iOS ▸ Framework & Library ▸ Framework. Click Next.
Creating Your Framework. From Xcode, choose File > New Project to create your project. Follow the prompts to select the type of framework you want and where you want to put your project directory. The default templates that come with Xcode let you specify whether you want to create a Carbon or Cocoa framework.
This approach works very well:
https://github.com/jverkoey/iOS-Framework#walkthrough
And you can use with CocoaPods (http://cocoapods.org/) with this simple fix: https://github.com/jverkoey/iOS-Framework/issues/46
Just change the xcodebuild line in the Framework target run script:
# Build the other platform.
xcodebuild ONLY_ACTIVE_ARCH=NO -workspace "${PROJECT_DIR}/${PROJECT_NAME}.xcworkspace" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}" $ACTION
Creating a framework is not hard, you are probably taking the long way using the template. Follow this steps:
The script on the third Blog will give you the structure that Apple recommends, but all of them are great. I managed to build one framework using cocoa pods by setting a preprocessor macro COCOAPODS=1 and adding a user defined config setting PODS_ROOT : "${SRCROOT}/Pods". All of this on the settings of your bundle. You can also try setting the info tab of your Xcode project, under Configurations, to use Pods as your configuration file, but it may give you duplicate symbols, not sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With