#LoopBack cheat sheet
##Recipies
Instantiate the sls-sample-app
slc example
cd sls-sample-app
slc install
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
namespace AccessImageMetadata | |
{ | |
public class Application |
/** | |
* The following snippet will ask the user to rate your app the second time they launch it. | |
* It lets the user rate it now, "Remind Me Later" or never rate the app. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
win.addEventListener('open', checkReminderToRate); | |
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' })); | |
win.open(); | |
function checkReminderToRate() { |
// inspired on http://www.joelpeterson.com/clock/ | |
// and most of the code taken from there as well | |
var win = Ti.UI.createWindow({ | |
orientationModes: [3, 4] | |
}); | |
var clock_bg = Ti.UI.createView({ | |
backgroundColor: '#444444', | |
top: 20, | |
left: 20, |
#!/bin/sh | |
# | |
# Copyright (c) 2010 Warren Merrifield | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
/** | |
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left, | |
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view. | |
*/ | |
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/; |
// Include framework files | |
Ti.include('system/core.js'); | |
// Set app preferences | |
var App = new TiGantry( | |
'0.1', // App version | |
'Zergling', // App version name | |
'tweetrdone', // Name of app | |
'app', // Location of app directory | |
'controllers', // Location of controllers directory |