I'm new to coding Swift, so please excuse me if this error is a simple answer.. I am trying to transfer data to another viewcontroller, but struggling with "Type of expression is ambiguous without more context" error.
I made a @IBoutlet var mainTableView inside of the Viewcontroller right now.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let indexPath = mainTableView.indexPathForSelectedRow {
habitSelected = habitlist[indexPath.row]
}
Here's full code I made