Skip to content

Instantly share code, notes, and snippets.

@saiten
Created September 13, 2011 08:02
Show Gist options
  • Save saiten/1213381 to your computer and use it in GitHub Desktop.
Save saiten/1213381 to your computer and use it in GitHub Desktop.
TiTestFlight sample
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