1
\$\begingroup\$

I'm trying to define a new window for use inside a Classic Titanium application for iOS. For the window to work properly, some preprocessing is required. This preprocessing includes the creation of the UI components -- such as labels, tables, and buttons --, the assembling of this components, and the addition of event listeners. However, I don't think this is the best way to do it. Any insight?

function LandingPage() {
    this.prepareForExecution();
}

LandingPage.prototype = {
    constructor: LandingPage,

    _proxy: Ti.UI.createWindow({
        title: "To Do List",
        backgroundColor: "#FFFFFF",
        navBarHidden: false,
        orientationModes: [
            Ti.UI.PORTRAIT,
            Ti.UI.LANDSCAPE_RIGHT,
            Ti.UI.LANDSCAPE_LEFT
        ]
    }),

    get proxy() {
        return this._proxy;
    },

    prepareForExecution: function () {
        this.createUIcomponents();
        this.buildUserInterface();
        this.addEventListeners();
        this.populateTaskTable();
    },

    ...
};
\$\endgroup\$
1
  • \$\begingroup\$ The best way is to use Alloy, not Classic \$\endgroup\$
    – Topener
    Aug 3 '16 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.