Add a warning if the user didn't implement the on_refresh method or they specified a callback method but didn't implement it.

This commit is contained in:
Mark Rickert
2013-05-06 19:38:18 -04:00
parent 5a57ab6005
commit 45d726133c

View File

@@ -19,7 +19,11 @@ module ProMotion::MotionTable
# UIRefreshControl Delegates
def refreshView(refresh)
refresh.attributedTitle = NSAttributedString.alloc.initWithString(@refreshing)
self.send(@refreshable_callback) if @refreshable_callback
if @refreshable_callback && self.respondsToSelector(@refreshable_callback)
self.send(@refreshable_callback)
else
ProMotion::Console.log("ProMotion Warning: you must implement an on_refresh method in your TableScreen.", with_color: ProMotion::Console::RED_COLOR)
end
end
def start_refreshing