# Introduction  
Cordova for iOS ships as a static library.  For Astro we include it as a 
framework so that plugins work properly without being modified.  Cordova 
plugins `#include` Cordova files as `#import <Cordova/CDV.h>`.  If we 
compile Cordova into Astro, then the module name becomes "Astro" for all 
Cordova classes and `#import <Cordova/CDV.h>` needs to become 
`#import <Astro/CDV.h>`.  This is confusing and error prone and so we 
don't do that.

Instead, Cordova is referenced as it's own framework. Cordova doesn't 
ship with a Framework target (only static `.a` library). When upgrading
to a new version of Cordova we have to re-integrate the new files into
the Cordova.framework target. Do _not_ delete the entire project and 
re-create. There be dragons in that path. :) 

#Upgrading 
Upgrading the Cordova library to the newest version is fairly straightforward.
All we need to do is get the updated code and swap in the new classes. The goal
is to not have to touch project settings or re-create the Cordova.framework
target!

1. Download the latest iOS tarball (`cordova-ios-X.Y.Z.tgz`) from the Apache
Cordova [distribution page](https://www.apache.org/dist/cordova/platforms/).
1. Delete all files in the `Classes` directory (if the updated code includes
   a `Classes` folder the easiest thing to do is simply delete the `Classes`
   folder in the project and drag it in from the downloaded update. Be sure
   *Create Groups* is selected, *Copy Items if Needed* is checked off, and
   the *Cordova* target is selected.) This will cause all of the code files 
   that you have dragged in to be added to the Cordova target.
1. Now you need to set the appropriate header files to be *Public*. The 
   easiest way to do this is to begin by compiling the *Sandbox* project.
   You will get compiler errors about `.h` files not being found. For each
   file, select it in the *Project navigator* and change it's visibility
   to *Public* under the *Target Membership* section of the *File inspector*.
   You will need to keep attempting to compile and marking the next file
   as *Public* until it compiles cleanly. 

That's it!