Search code examples
swiftparse-platformpull-to-refresh

Detect when pullToRefresh is called on swift


Is there a way to detect when the pullToRefresh has been called on a Parse - PFQueryTableViewController?

I've found some of that on objective-c, but nothing on swift.


Solution

  • As far as I know, pullToRefresh is a private implementation, so you can't override it to detect calls. However, pulling to refresh will trigger the loadObjects function, which in turn triggers the objectsWillLoad and objectsDidLoad methods. You can override the 2 methods to do whatever you want to do.

    The only drawback is that objectsWillLoad and the did load counterpart will be called even when the view is initially displayed.