I have a parentview which has 2 child views, I am trying to show a uiviewcontroller as "Present modally" I use the following code:
class ParentCtrl: ButtonBarPagerTabStripViewController {
let obj = ChildCtrl()
override func viewDidLoad() {
super.viewDidLoad()
obj.someClassMethod()
}
}
class ChildCtrl: UIViewController, IndicatorInfoProvider {
struct Storyboard {
static let segue_id = "segue_id"
}
public func someClassMethod(){
self.performSegue(withIdentifier: Storyboard.segue_id, sender: self)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if(segue.identifier == Storyboard.segue_id){
let destino = segue.destination as! NewViewController
destino.seleccion = seleccion
}
}
}
But I get the following error:
has no segue with identifier 'segue_id'' But Yeah, I have that identifier because if I copy:
self.performSegue(withIdentifier: Storyboard.segue_id, sender: self)
in the viewDidload method the NewViewController is presented
How can I solve that?