I have created a table view cell in story board and i created a cocoa touch class for it.In that it will have one button, so here i want to navigate to another view controller on clicking on the button programmatically.
This my code
@IBOutlet weak var findOutButton: UIButton!
override func awakeFromNib()
{
super.awakeFromNib()
findOutButton.addTarget(self, action: Selector(("action:")), for: UIControlEvents.touchUpInside)
}
func action(sender: UIButton) {
let vc5 = self.storyboard.instantiateViewController(withIdentifier: "DescriptionViewController") as? DescriptionViewController
self.navigationController?.pushViewController(vc5!, animated: true)
}
Here its showing error in this line
let vc5 = self.storyboard.instantiateViewController(withIdentifier: "DescriptionViewController") as? DescriptionViewController ` like "value of type 'TableViewCell' has no member 'storyboard'.
Thanks in advance.Help me to clear out the error.