0

We have this:

self.refreshControl?.addTarget(self, action: #selector(MyController.userRefresh(refreshControl:)), for: UIControlEvents.valueChanged)

func userRefresh (refreshControl: UIRefreshControl) {
    sync()
}

Is there another UIControlEvents event which we can listen to in order to execute code prior to the UIRefreshControl beginning to spin?

For the valueChanged event the spinner is already active.

Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
  • I've never seen anything other than `.valueChanged` used for the default `UIRefreshControl`. Would you mind me asking why you need to call something before the refresh starts? Your best bet might be to create a custom refresh control and use that instead – jackchmbrln Apr 15 '17 at 14:15
  • If we can't successfully complete a refresh request we show an error over the table where the refresh control shows. If the user decides to again try to pull to refresh then we want to hide this message. – Marcus Leon Apr 15 '17 at 14:24
  • 1
    You want to hide this message and retry? or hide this message and do nothing? I see no point in having code run before the control starts spinning – Alistra Apr 15 '17 at 15:39
  • Want to hide the message then show the refresh control and retry – Marcus Leon Apr 15 '17 at 19:02

0 Answers0