Skip to content

Instantly share code, notes, and snippets.

@himalay
Forked from FokkeZB/app.js
Last active August 29, 2015 14:17
Show Gist options
  • Save himalay/ff9dfceeed670f054c62 to your computer and use it in GitHub Desktop.
Save himalay/ff9dfceeed670f054c62 to your computer and use it in GitHub Desktop.
How to decide what window to open first in Titanium Alloy. You can remove all markup from the index.xml view (the file itself must be there!) and then create another controller based on your logic.
/* /Resources/app.js - Generated by Alloy, here to understand the flow */
var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone;
Alloy.createController("index");
/* /app/controllers/index.js */
if (Ti.App.Properties.getBool('isLoggedIn', false)) {
Alloy.createController("home");
} else {
Alloy.createController("login");
}
<!-- /app/views/index.xml -->
<Alloy />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment