Chapter 10. API Reference
As with any library, Titanium offers an integrated API that gives you
access to the features it has to offer. The Titanium API is organized into
several different namespaces, which are fairly self explanatory. For
instance, UI components exist in the Titanium.UI namespace and can be invoked as
Titanium.UIxxx.
When referring to Titanium methods and constants, Ti can be used instead of Titanium. So Ti.UI.createTableView is the same as Titanium.UI.createTableView.
The namespaces in this chapter range from fairly complex and full,
such as the UI namespace, down to ones that have only a method or two. These
namespaces also contain constants, which are JavaScript variables that
cannot be changed and that have a fixed meaning that’s useful in programming
with that namespace’s methods. Even though many times you need to look them
up in the reference material, it’s easier to use something like Titanium.UI.iPhone.TableViewStyle.GROUPED than
234587923. Furthermore, if Titanium changes the definition of a constant,
your code can be recompiled and still work without being rewritten.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access