Search code examples
swiftxcodepull-to-refreshuirefreshcontrol

How to activate refresh control without pulling down (Swift)


I want to show the spinner of refresh control in the table view immediately without the user pulling the table view down to refresh it. Is that possible to do? If yes, how can I implement it? I already have UIRefreshControl which runs for 7 seconds and then the other view pops up. Thanks!


Solution

  • The solution was quite simple:

    refreshControl.beginRefreshing()
    

    https://developer.apple.com/documentation/uikit/uirefreshcontrol/1624842-beginrefreshing