Created
September 13, 2011 08:02
-
-
Save saiten/1213381 to your computer and use it in GitHub Desktop.
TiTestFlight sample
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
testflight = require 'co.saiten.ti.testflight' | |
testflight.takeOff '[team token]' | |
Ti.API.info "start application" | |
baseWin = Ti.UI.createWindow() | |
nav = Ti.UI.iPhone.createNavigationGroup() | |
baseWin.add nav | |
root = Ti.UI.createWindow | |
title: "Sample" | |
table = Ti.UI.createTableView | |
data: [ | |
{ title: 'first', hasChild: true } | |
{ title: 'second', hasChild: true } | |
{ title: 'third', hasChild: true } | |
] | |
root.add table | |
table.addEventListener 'click', (e) -> | |
Ti.API.info "clicked : #{e.index}" | |
switch e.index | |
when 0 | |
testflight.passCheckpoint 'first' | |
win = Ti.UI.createWindow | |
title: 'first' | |
backgroundColor: 'blue' | |
nav.open win | |
when 1 | |
testflight.passCheckpoint 'second' | |
win = Ti.UI.createWindow | |
title: 'second' | |
backgroundColor: 'red' | |
nav.open win | |
when 2 | |
# crash | |
testflight.passCheckpoint 'third' | |
root.add null | |
nav.window = root | |
baseWin.open() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment