Protocol delegate method is not called..
First View controller code
class ViewController: UIViewController,customDelegate {
var
So basically in line var seconviewcontroller : SecondViewController = SecondViewController() is different from your pushing view controller instance.
You are making a separate instance of SecondViewController so you have done delegate self at the time of pushing with pushes object like that
let secondVCInstance = self.storyboard?.instantiateViewController(withIdentifier: "SecondViewController") as! SecondViewController
secondVCInstance.delegate = self
self.navigationController?.pushViewController(secondVCInstance, animated: true)
NOTE: - EVERY OBJECT HAS ITS OWN PROPERTIES