What if you want the user to be able to refresh the feed data in your table? You could create a regular button, or possibly check for new data after arbitrary time intervals. Alternatively, you can implement a cool "pull and refresh" mechanism, which has become the de facto standard refresh method in iOS.
In this recipe for our recipe finder app, we'll implement this very type of refresh mechanism for our recipes' feed using the built-in, native refresh control.
Open your recipes.js
file and type the following under the creation of tblRecipes
:
if (Ti.Platform.name === "iPhone OS") { var p2r = Ti.UI.createRefreshControl({ tintColor: '#000' }); tblRecipes.refreshControl = p2r; p2r.addEventListener('refreshstart', function(e) { refresh(function() { p2r.endRefreshing(); }); }); } else if (Ti.Platform.name === "android") { win.addEventListener...