This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ios> | |
| <min-ios-ver>4.3</min-ios-ver> | |
| <plist> | |
| <dict> | |
| <key>UISupportedInterfaceOrientations</key> | |
| <array> | |
| <string>UIInterfaceOrientationPortrait</string> | |
| </array> | |
| <key>UISupportedInterfaceOrientations~ipad</key> | |
| <array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var MyModule = {}; | |
| // auth info | |
| MyModule.somevariable = 'http://www.google.com/'; | |
| MyModule.someFunction = function(...) { | |
| ... | |
| } | |
| module.exports = MyModule; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // include our reusable component | |
| // | |
| var BeerRow = require('BeerRow'); | |
| // | |
| // create our rows | |
| // | |
| for (var i in beers) { | |
| var newRow = new BeerRow(beers[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Shannon Hicks | |
| */ | |
| // detect screen density once because Ti.Platform.displayCaps calls are expensive | |
| var retina = Ti.Platform.displayCaps.density == 'high'; | |
| var BeerRow = function(beer) { | |
| // create a container object | |
| var row = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| outerloop: | |
| for (var i=0;i<10;i++) { | |
| Ti.API.debug('outerloop: '+i); | |
| innerloop: | |
| for (var x=0;x<10;x++) { | |
| Ti.API.debug('innerloop: '+x); | |
| if (x === i) { | |
| break innerloop; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var MyCustomWindow = function(navController,title,number,points) { | |
| var win = Ti.UI.createWindow({custom stuff here}); | |
| return win; | |
| }; | |
| module.exports = MyCustomWindow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var secondCall = require('TestSingleton'); | |
| var NewWindow = function() { | |
| var win = Titanium.UI.createWindow({ | |
| title:'Win 2', | |
| backgroundColor:'#c00' | |
| }); | |
| var label1 = Titanium.UI.createLabel({ | |
| color:'#999', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Common(input) { | |
| this.phrase = input; | |
| }; | |
| Common.prototype.doIt = function() { | |
| return this.phrase; | |
| }; | |
| module.exports = Common; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test gist |