You can add optional MobileFirst features
to your existing MobileFirst app
project. The required framework and library files can be generated
by IBM MobileFirst™ Platform Foundation by
using IBM MobileFirst Platform Operations
Console and
added to your Xcode project. The Xcode project must be then configured
correctly according to your development goals.
Before you begin
You must have
About this task
Optional frameworks
In
addition to the core MobileFirst framework
many optional frameworks are available. You can limit the size of
your app by including only those frameworks required by the features
you use. Some optional frameworks require imported headers in your
code.
Table 1. Optional frameworks for iOSFeature |
Frameworks (linked in the Link Binary with Libraries list
in the Build Phases tab) |
JSONStore |
IBMMobileFirstPlatformFoundationJSONStore SQLCipher
In
addition, import the IBMMobileFirstPlatformFoundationJSONStore header
to your code. For more information on setup, see JSONStore.
|
OpenSSL |
openssl IBMMobileFirstPlatformFoundationOpenSSLUtils
For
more information on OpenSSL, see Enabling OpenSSL for iOS
|
Push |
IBMMobileFirstPlatformFoundationPush For
more information, see Push notification.
In
addition, import the IBMMobileFirstPlatformFoundationPush header
to your code.
|
watchOS |
IBMMobileFirstPlatformFoundationWatchOS.
The watchOS framework requires a different structure for the Xcode
project. For information on adding the watchOS framework, see Adding
watchOS frameworks. |
Procedure
- In your Xcode project, add the MobileFirst framework
files to your project.
- Select the project root icon in the project explorer.
- From the File menu, choose the Add
Files option and navigate to the folder that contains
the framework files.
- Click the Options button.
- Select Copy items if needed and Create
groups for any added folders options.
Note: If
you do not select the Copy items if needed option,
the framework files are not copied but are linked from their original
location.
- Select the main project (first option) in the Add
to targets box.
- Choose the framework files (from the previous table)
relevant to your project according to your chosen features.
- Click Add.
Note: These
steps copy the relevant MobileFirst frameworks
to your project and link them within the Link Binary with
Libraries list in the Build Phases tab.
If you link the files to their original location (without choosing
the Copy items if needed option as described
previously) you need to set the Framework Search Paths as
described below.
- Optional: If you
did not copy the framework files into your project as described previously,
using the Copy items if needed option, in the Build
Phases tab:
- Open the Build Settings page.
- Find the Search Paths section.
- Add the path of the folder that contains the frameworks
to the Framework Search Paths folder.
Results
You now have additional frameworks added to your project.
Add the required headers to your code according to the
Table 1 table.
You
must import the headers for some of the frameworks. The syntax depends
on the development language:
Objective C:
#import <IBMMobileFirstPlatformFoundation/[frameworkname].h>
Swift:
import [frameworkname]
What to do next
Before you can accesss server resources, you must register
your app. See
Registering iOS applications from the MobileFirst Platform CLI