Closed xiaoyifan closed 9 years ago
viewWillAppear
is called every time the view controller come on screen (e.g. from changing tabs). If you add a refresh control here, you will add one every time you switch to this view controller. You should put it in viewDidLoad
because it will only ever be called once, and you only ever need one refresh controller.
Got it ! Thanks!
when I tried to init UIRefreshControl and do the refresh job in viewWillAppear, it didn't work. And it works in viewDidLoad. And there appears a hint in console like:" attempting to change the refresh control while it is not idle is strongly discouraged. " I'm kinda confused. Can anyone help me to explain that?