Embedding a framework within a framework (iOS 8+)
Note: This is possible and is being used in production (for e.g., with Swift frameworks in CocoaPods).
- Convert UTF-8 encoding to ISO 8859-1 encoding with NSString
- Hidden UINavigationController inside UITabBarController
- Is there a way to make a custom NSWindow work with Spaces
- Creating Excel (.xlsx) files in Cocoa
- Mac app has embedded provisioning profile
- Checking keyDown event.modifierFlags yields error
3 Solutions Collect From Internet About “Embedding a framework within a framework (iOS 8+)”
Found the answer. Here’s how it’s done:
- Navigate to Target > Build Phases
- Click the small “+” icon and select “New Run Script Build Phase”
Paste the following:
cd $BUILT_PRODUCTS_DIR mkdir $PROJECT_NAME.framework/Frameworks &>/dev/null for framework in *.framework; do if [ $framework != $PROJECT_NAME.framework ]; then cp -r $framework $PROJECT_NAME.framework/Frameworks/ &>/dev/null fi done
@Vatsal Manot’s answer was very helpful for me. I modified it a bit and also had a need to sign the copied embedded framework. My script is below.
cd $BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Frameworks/Custom.framework/Frameworks for framework in *.framework; do mv $framework $BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Frameworks/ /usr/bin/codesign --force --sign "iPhone Developer" --preserve-metadata=identifier,entitlements --timestamp=none $BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Frameworks/$framework done
To create a Umbrella Framework that contains a Sub-Framework you can follow the step-by-step guide written down here: Umbrella framework
- XCode 5 Debug Navigator Memory disagrees with Instruments
- HTTP digest authentication fail due to wrong nonce-count in iOS 10
- Showing a UIPickerView with UIActionSheet in iOS8 not working
- iOS prevent subview of tableview from scrolling with tableview
- Mysterious crash on iOS 8
- Call to a number, which contain #. (IPhone SDK)
- Block inside block = EXC_BAD_ACCESS
- Is there an alternative to ios-ntp to get atomic/ current time ios?
- Uninstalling app from iOS Device thru command line
- Xcode sort array by specific (NSString) dictionary key (like sql query)
- Converting PathForResource To String Returning nil Swift
- How do I record a video on iOS without using a preset?
- How to get iPhones current orientation?
- iOS: Removing UINavigationBar animation
- iOS 8+ framework with nested embedded framework