I'm making an app that fetches data from CloudKit and displays it in a tableview. At the end of my viewDidLoad, I call a different function to fetch this data and filter it. However, my tableView numberOfRowsInSection function seems to get called before my fetching function, and so I get no rows in my tableView since hasn't gone through my fetching function yet, and a view I have assigned as a background view pops up, as it should when I have no rows. I'd like to know, is there a way to call my tableView numberOfRowsInSection function again at the end of my custom function, so that it can update the tableView? I know how to call a normal function:
function(any parameters here)
I can't seem to figure out how to call this, though:
tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
Assume I can't move my fetching function code into ViewDidLoad.
question from:
https://stackoverflow.com/questions/65909826/how-to-manually-call-tableview-numberofrowsinsection-function 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…