Skip to content

Instantly share code, notes, and snippets.

@FokkeZB
Created April 19, 2013 08:17
Show Gist options
  • Save FokkeZB/5418883 to your computer and use it in GitHub Desktop.
Save FokkeZB/5418883 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 />
@bert-w
Copy link

bert-w commented May 13, 2015

i actually ran across this issue today. I dislike the implementation and the suggested solution a lot. It would make it a hell of a lot easier to just remove the line Alloy.createController('index') from automatically being compiled into the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment