You can get framework and library files that are required
for MobileFirst development
by creating a MobileFirst project
and copying certain generated files into your Xcode project. Then,
in Xcode, you configure what frameworks, libraries, and build settings
to include.
About this task
You need to copy and reference the
files generated from MobileFirst Studio or
the MobileFirst
Platform Command Line Interface to
your native iOS project in the Xcode development environment in order
for Xcode to find the frameworks and libraries for linking. There
are additional settings that need to be configured.
Procedure
Setting up the Xcode project to include the MobileFirst API.
- In your Xcode project add the MobileFirst files
to your project:.
- Select the project root icon in the project explorer.
- From the File menu choose the AddFiles option
and add the WorklightAPI folder and the worklight.plist file
from your MobileFirst project.
- Select Copy items if needed and Create
groups for any added folders options.
- Click Add.
Note: These
steps add the MobileFirst frameworks
to the Link Binary with Libraries list in the Build
Phases tab.
- Make sure the following resources are linked to your project
in the Link Binary With Libraries section of
the Build Phases tab.
Important: If
you are using Xcode 7, link libstdc++.6.tbd, libz.tbd,
and libc++.tbd, instead of the corresponding .dylib files.
Using Xcode 7 and iOS9 require the latest interim fix.
Important: If
you are using the latest interim fix link these framework:
- openssl.framework
- If you want to enable the JSONStore feature (which is optional
in the latest interim fix) link the following frameworks:
- IBMMobileFirstPlatformFoundationJSONStore.framework
- SQLCipher.framework
- If you are using the JSONStore feature, import the IBMMobileFirstPlatformFoundationJSONStore framework.
For Objective C
#import <IBMMobileFirstPlatformFoundationJSONStore/IBMMobileFirstPlatformFoundationJSONStore.h>
For Swift
import IBMMobileFirstPlatformFoundationJSONStore
- Optional: If the required frameworks do not
appear in the Build Phases tab:.
- Open the Build Settings page.
- Find the Search Paths section.
- Add the following entry to the Framework
Search Paths: $(PROJECT_DIR)/WorklightAPI/Frameworks.
If you did not copy the folder into the Xcode project, enter the full
path of the WorklightAPI folder.
- in the Other Linker Flags field,
enter the following value: -ObjC
- If you are using Swift see Configuring a Swift application
- In the Deployment section,
select a value for the iOS Deployment Target field
that is greater than or equal to 6.0.
- Optional: Set the build
options.
Important: If
you are using Xcode 7, in the Build Settings tab:
- Open the Build Options section.
- Set Enable Bitcode to No.
For more information, see Disabling bitcode in Xcode builds.