swift - ScrollView UIRefreshControl is not calling function -


i added refreshcontrol scrollview in ios 10 swift 3, added function not called.

here code.

let rc = uirefreshcontrol() rc.addtarget(self, action: #selector(refresh), for: uicontrolevents.valuechanged) if #available(ios 10.0, *) {     scrollview.refreshcontrol = rc }  ...  @objc func refresh(_ sender: anyobject) {     let response = serverhelper.send(word: jsonparser.getallgamesforplayer(player: localplayer))     let games = jsonparser.parsetoarraydic(string: response)     print("all games \(games)")     addallgamebuttons(games: games)     sender.endrefreshing() } 

i want refreshcontol calling refresh function. function never called. i'm doing wrong here?

edit

the refreshcontrol working, problem is, have scroll down end of screen function gets called. scrollview has high of 1200 px. knows how solve this?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -