12

I have a static group of cells, a few groups actually, and for some reason the pull to refresh function is enabled, I can't figure out where, at least in Xcode Interface builder an option is to disable that. I assume I'll have to do it programmatically.

Does anyone know how this needs to be done in Swift?

trever
  • 901
  • 2
  • 7
  • 23

3 Answers3

14

If you're using UITableViewController, it should be something as simple as

self.refreshControl = nil
Chris Loonam
  • 5,693
  • 6
  • 43
  • 61
  • DUH. I thought I tried that. Xcode UI said "The default value of this property is nil" but when I did it, it worked. So that's confusing. Thank you though! – trever Oct 10 '15 at 22:23
  • I'll accept the answer when stack overflow decides it's time lol – trever Oct 10 '15 at 22:28
  • I tried this in the initWithStyle, but it looked like preventing the navigation bar to appear; I moved it to the viewDidLoad, AFTER un-hiding the navigation bar, and it worked well, without collateral effects. Up-voted anyway. – Giorgio Barchiesi Oct 01 '19 at 11:19
4

In storyboard, go to your Attributes Inspector for your View Controller and disable it there where it says 'Refreshing':

enter image description here

VeganKid
  • 477
  • 5
  • 16
3

For swift 4 you can using

 self.yourTableView.refreshControl = nil
Duy Phan
  • 763
  • 6
  • 5