How do I create Components from my Existing Apps?
An iOS component for the Developer Garden Marketplace is nothing more than an objective-c library optionally packaged with calls to Developer Garden Licensing SDK to protect your API.
To expose your APIs correctly for developers, you should make both a simulator build and a production build (targeted to a real device like iPhone, iPad or iPod touch). Along with the binary “.a” files, you will also need to include header (“.h”) files so that developers can compile against your APIs. If you already have an application, portions of your application may be exposed as components for developers.
For example, if you have a shopping comparison application where you can scan barcodes and perform a pricing lookup for a product, one useful function in this application that you may want to sell to other developers is the barcode reader. So, to expose this feature as a component, you have to isolate the parts related to barcode scanning. Start a new project and bring over the source files related to that feature. In XCode, you will create a new project using the “Cocoa Touch Static Library” template. You will need to ensure that you have no dependencies on other parts of your application as you bring your code in. Remember that you will be distributing binary “.a” files to developers. So, this component must be self-contained and not have dependencies on your original application. Once you have built a “.a” library, try using it in a small test application designed to adequately test the functionality and interfaces of your component. Note that you will be submitting this test application in source code form when you submit your component into the Developer Garden Marketplace.
Once you are satisfied with the component, you can refer to the Developer Garden Licensing SDK to embed the licensing code into your component. You will also be embedding a public key into your component. In your test application, add the code from the license SDK to pass in a sample license key you obtained from Developer Garden Marketplace (see Developer Garden Licensing SDK for details). The application should function the same as before with a valid license key. If you modify the license key, the API should stop working. Submit this test application that contains the license code to the Developer Garden Marketplace. The Developer Garden Marketplace will use your sample application to help with the approval process.
Finally, you should have documentation on how to use your component along with an API reference guide. The reference guide should document all of the APIs that the component exposes. We recommend using an open source tool called doxygen to generate the reference guide from your “.h” header files. In addition to the reference guide, you should also include a user/developer guide. This should describe what your component does, how it works, and describe the various features and how to use those features in an application.
We recommend this document to be PDF or HTML formatted. Please refer to one of our sample components for an example of how to create proper documentation for your own component.

