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
Post a Comment