Frameworks and Libraries
You may want to use iOSDefender SDK with other types of iOS projects, such as an XCFramework or a Static Library.
XCFrameworks
You can use iOSDefender SDK in your own XCFramework projects. It is recommended that you build an XCFramework rather than the default framework, as XCFrameworks will work on both real devices and simulators, but normal frameworks will only work on one or the other.
Internal Only
If the XCFramework you are building will not be distributed to any 3rd parties, follow these steps to include it in your own app:
Include iOSDefender SDK in your own XCFramework project by following the instructions in Getting Started.
Include iOSDefender SDK in the iOS App that is using your XCFramework by following step 2 of the instructions in Getting Started.
XCFrameworks for Distribution
If you will be distributing your XCFramework to 3rd parties, follow these steps to make your XCFramework an Umbrella XCFramework that will include iOSDefender SDK in its distribution:
Include iOSDefender SDK in your XCFramework project by following the instructions in Getting Started.
Build your XCFramework and include the resulting product in a client app.
Since all frameworks used by an app need to be codesigned, a new Run Script Phase must be added to your client app's build phases, replacing
UmbrellaFramework
with your framework's name.Note: even though your framework will have a file extension of
.xcframework
, the script should still target a folder with your framework's name and the extension.framework
.( cd "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Frameworks/UmbrellaFramework.framework/Frameworks" && for EACH in *.framework; do echo "-- signing ${EACH}" /usr/bin/codesign --force --deep --sign "${EXPANDED_CODE_SIGN_IDENTITY}" --entitlements "${TARGET_TEMP_DIR}/${PRODUCT_NAME}.app.xcent" --timestamp=none $EACH done )
Warning: If this build phase is not included, your app will work in the simulator but it will not work on real devices.Rename the new build phase to something like
Codesign UmbrellaFramework's Sub-frameworks
, substituting your frameworks name forUmbrellaFramework
.
Static Libraries
It is not possible to include iOSDefender SDK in a Static Library. Static Libraries are compiled resources that have not been linked. Our framework is a compiled binary that has already gone through the linking process, and some information that is discarded during the linking process cannot be reconstructed to produce a combined Static Library.