got 2 ViewControllers 1st is ViewController 2nd TableViewCotnroller
class ViewController: UIViewController, CLLocationManagerDelegate, TabVCDelegate {
func reciveData(_ numberOfRows: Int) {
print(numberOfRows)
}
...
}
TableViewController:
protocol TabVCDelegate {
func reciveData(_ numberOfRows: Int)
}
class TabVC: UITableViewController {
var delegate: TabVCDelegate?
@IBAction func passDataBack(_ sender: UIButton) {
delegate?.reciveData(5)
self.dismiss(animated: true, completion: nil)
print(delegate ?? "show me if its nil")
}
my delegate?.reciveData(5) is for some reason nil can't figure it out it did worked when i had 2 normal ViewController am i missing something about TableViewControllers? or maybe its something else? any help would be appreciated.