Forging Titanium Episode 3: Custom UI Components

0 Flares 0 Flares ×
Editor’s note: This and future episodes of Forging Titanium are available here. In last week’s episode, we created a cross-platform Navigation Controller as a custom component we could use to organize windows in a Titanium application. This week, we will be taking a deeper look at how to extend core Titanium objects and create our own custom UI components. In order to accomplish this, we will be using a technique popularized by JavaScript luminary Douglas Crockford, which is called parasitic inheritance. Parasitic inheritance takes advantage of the malleable nature of JavaScript objects, allowing a developer to create an instance of a given type, modify it with additional properties, and return it as a new type of object. This is a very powerful technique in JavaScript applications generally, but is even more useful and powerful when dealing with JavaScript proxy objects in Titanium. We can use factory functions in the Ti.UI namespace to create base UI components, and then extend those components with new features and functionality we define ourselves. Find out how use this technique to create a custom ratings widget in this week’s episode of Forging Titanium. Episode Resources:
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

Sign up for our blog!

computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×