python build.py && rm -Rf /Library/Application\ Support/Titanium/modules/iphone/customcamera && unzip customcamera-iphone-0.1.zip -d /Library/Application\ Support/Titanium/
This is a skeleton Titanium Mobile iPhone module project. Modules can be used to extend the functionality of Titanium by providing additional native code that is compiled into your application at build time and can expose certain APIs into JavaScript.
Choose a unique name for your module to not cause conflict with other third-party
modules. Typically, we recommend prefixing your module with a token that identifies
your organization. In the future, we may provide the ability to register your own
top level namespaces. Currently, all modules will be available only via the
Titanium namespace. For example, if your module is named MyFirstModule
, you would
access module APIs via the API: Titanium.Myfirst
. The module in the name will
automatically be removed when resolving your module. Also, all characters after the
first are always lower-cased.
Components that are exposed by your module must follow a special naming convention. A component (widget, proxy, etc) must be named with the pattern:
Ti<ModuleName><ComponentName>Proxy
For example, if you component was called Foo, your proxy would be named:
TiMyfirstFooProxy
For view proxies or widgets, you must create both a view proxy and a view implementation. If you widget was named proxy, you would create the following files:
TiMyfirstFooProxy.h
TiMyfirstFooProxy.m
TiMyfirstFoo.h
TiMyfirstFoo.m
The view implementation is named the same except it does contain the suffix Proxy
.
View implementations extend the Titanium base class TiUIView
. View Proxies extend the
Titanium base class TiUIViewProxy
or TiUIWidgetProxy
.
For proxies that are simply native objects that can be returned to JavaScript, you can
simply extend TiProxy
and no view implementation is required.
- Edit manifest with the appropriate details about your module.
- Edit LICENSE to add your license details.
- Place any assets (such as PNG files) that are required in the assets folder.
- Edit the titanium.xcconfig and make sure you're building for the right Titanium version.
- Code and build.
You can edit the file module.xcconfig
to include any build time settings that should be
set during application compilation that your module requires. This file will automatically
get #include
in the main application project.
For more information about this file, please see the Apple documentation at:
You should provide at least minimal documentation for your module in documentation
folder
using the Markdown syntax.
For more information on the Markdown syntax, refer to this documentation at:
http://daringfireball.net/projects/markdown/
The example
directory contains a skeleton application test harness that can be
used for testing and providing an example of usage to the users of your module.
- Run
build.py
which creates your distribution - cd to
/Library/Application Support/Titanium
- extract your zip into this folder
Register your module with your application by editing tiapp.xml
and adding your module.
Example:
When you run your project, the compiler will know automatically compile in your module dependencies and copy appropriate image assets into the application.
Currently, you will need to manually distribution your module distribution zip file directly. However, in the near future, we will make module distribution and sharing built-in to Titanium Developer!
Cheers!