The first contact with Cordova was frightened by the Installation Guide on the official website. Later, we found that Cordova is a static library, which is easy to handle. Directly introduce it to our ready-made projects as a static library.
The steps are as follows. Fortunately, I persisted and continued to find another piece of information. The combination of the two pieces of information would be perfect. So I wrote a blog and saved it. I hope it will help you)
Follow the steps in English.
Use Cordova for iOS as static libraryby admin on Thu, 02/28/2013-11: 10
After version 2.0.0 Cordova library for iOS provided as xcode project.
The main problem is that you can not open two projects with Cordova, only one.
But you can use the following trick to get around this.
1. Set "Skip install" Property of cordovalib project to "no ". In this configuration, you must set no. Skip the restrictions that can be used to install cordeva.
2. Run "product" => "ARCHIVE" command from menu. After successful build was opened Organizer-archives (release version is used here)
3. Press "Distribute" button, select "Save build products" and press next
4. Save Cordova Library Build
5. On file system you can see a files
6. After it You cocould include this file in own project
6.1 open "build phases" tab and in "link binary with libraries" Press plus button, in dialog press "add other..." and select libcordova. A file
Introduce the released Lib.
6.2 open "build Settings" tab, find property with name "header search paths" and write full path to "include" folder of compiled Cordova Library
The path is where you previously released the Lib. Find the include file and drag the folder to "header search paths ". Select recursive.
7. Don't forget the reference of the header file (I forgot it from the beginning and struggled for a long time)
#ifdef CORDOVA_FRAMEWORK #import <Cordova/CDV.h>#else #import "CDV.h"#endif
You woshould just have:
#import <Cordova/CDV.h>
It is best to put these two header files in the prefix file so that you do not need to write import everywhere.