I currently have a tableview cell that contains a button. Once clicked it calls a function on the main vc and performs a segue. However, since upgrading to iOS 14 it produces an error. It worked great before without issue. I've also tried using dispatch async and it didn't fix the issue.
The new error returned is:
Exception = (NSException *) "*** __boundsFail: index 2 beyond bounds [0..1]"
The code looks like this:
class MainVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
func showNextVC() {
performSegue(withIdentifier: "MainVC->NextVC", sender: self)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! TableviewCell
cell.vc = self
return cell
}
}
class TableviewCell: UITableViewCell {
weak var vc: MainVC?
@IBAction func touchupinsideButton(_ sender: UIButton) {
vc?.showNextVC()
}
}
There are no changes the the tables rows after it is clicked. It's a very simply action. Any ideas?!