I have added a protocol that makes a segue from a UIView button to a NavigationController but when i compile and press the button after the UIView opens it just does nothing which seems pretty weird since it all makes sense to me at least, Please if I am doing anything wrong lead me to fix my code.
I got this code from this Answer: https://stackoverflow.com/a/52789290/18277261
Code:
class popUpView: UIView, UITextFieldDelegate {
@IBOutlet weak var popUpViewInterface: UIView!
@IBOutlet weak var payNowPopUp: UIButton!
let delegate: popUpViewDelegate? = nil
@IBAction func payNowToWebView(_ sender: Any) {
let myColor = UIColor.red
priceTextFieldPopUp.layer.borderColor = myColor.cgColor
priceTextFieldPopUp.layer.borderWidth = 1.0
self.delegate?.performSegueFromView(withIdentifier: "paymentWebView")
}
}
protocol popUpViewDelegate {
func performSegueFromView(withIdentifier identifier: String)
}
class dashboardViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, UICollectionViewDataSource, ChartViewDelegate, AxisValueFormatter, popUpViewDelegate {
func performSegueFromView(withIdentifier identifier: String) {
self.performSegue(withIdentifier: identifier, sender: nil)
}