Using the Pull To Refresh Control

The pull to refresh control is created with the idea of providing a pull to refresh functionality

it is very simple and easy to use. here is the demo app to show you how easy it is to use

local _W = display.contentWidth
local _H = display.contentHeight

local pull = require("pull")

local group = display.newGroup()
local back = display.newImage("backdrop.jpg",true)


--Create the PullToRefresh Container
local p1 =

--Creat the UI for the app
local container = display.newGroup()
local scrollable = display.newRect(container,0,20,_W,_H*3)

local rect = display.newRect(container,10,30,100,100)

local logo = display.newImage(container,"logo.png",100,200)

local moveAbout = function ( e )
local phase=e.phase
if "began"==phase then
elseif "moved" == phase then
elseif "ended" == phase or "cancelled" == phase then
return true


--All the UI and code is created

--Set the container object to sit inside of the PullToRefresh

--Customise the message it shows when pulled down or when pulling down
p1.pullMessage("Pull it down to reval its secrets...")
p1.releaseMessage("Pop it to really reval its secrets...")

--The callback function that is called
local function testing ()
print ("Refreshed")
native.showAlert("Refresh","This is a call back function when refreshed",{"OK"})

--Set the callback function


  1. Hi,

    I know this is nearly a year old but was wondering where you get the pull.lua from ?

    I was searching on Google for a "Pull to refresh" type interface and came across this post.


  2. Hi Dave, that pull.lua is the code that I have written. Here's a link to the video if you want to see it in action.

  3. Looks good.

    Are these things you develop for yourselves or do you share the code anywhere ?


  4. Hi Dave,
    My full time profile is Mobile Development and Consultancy, I did post a couple of code snips, but components like these are the widgets that I can offer to other developers on a commercial basis, i.e. you they can buy them for use in their own apps.

    While some develop mobile apps for fun and hobby, this is my main business, so cannot offer it for free. However, I am rewriting these for adapting to the multiple resolutions (this was written for iPhone3 type devices only). The other components too will be available in a bit.

    Before you ask me the next question, these are available in the range of $10-$15 and the source code is obfuscated, so if you are after wanting to study the code, this format might not be the suitable for you and you might be unable to further extend this/these yourself.

    1. Hi, I saw the video. It looks like a good example. The question is how can I buy this?. Is there a link to buy from? or send you a message?. Just if you tell me how, I will appreciate that.


    2. Hi,
      You could have provided a name or some way to contact you. Anyways, you can send me a message, pay via paypal and on receipt of the funds, I can send you the file(s).



Post a Comment

Popular Posts