Skip to content

Instantly share code, notes, and snippets.

@botmaster
Forked from FokkeZB/app.js
Created October 16, 2013 09:23
Show Gist options
  • Save botmaster/7005037 to your computer and use it in GitHub Desktop.
Save botmaster/7005037 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