ios - Swift ViewController without prepareForSegue -
on project have master controller (which accessed segue has 3 nibs. these nibs not on main storyboard show on master view , can swipe across view them.
how 1 of nibs viewcontroller sent them?
for clarity
- viewcontroller1
- segue viewcontroller2
- display slide nibs (viewcontroller3).
- segue viewcontroller2
i want viewcontroller3 viewcontroller1 not on storyboard cant click , drag , make segue.
i hope makes sense.
edit: ibaction
let storyboard = uistoryboard(name: "main", bundle: nil) let secondvc = storyboard.instantiateviewcontrollerwithidentifier("viewcontroller1storyboardid") as! viewcontroller1 presentviewcontroller(secondvc, animated: true, completion: nil)
viewcontroller2 has this:
let vc3 = viewcontroller3(nibname: "viewcontroller3", bundle: nil) var frame3 = self.vc3.view.frame frame3.origin.x = self.view.frame.size.width * 2 self.vc3.view.frame = frame3 self.addchildviewcontroller(self.vc3) self.scrollview.addsubview(self.vc3.view) self.vc3.didmovetoparentviewcontroller(self)
with few lines add other frames , slide them
you can instanciate viewcontroller through storyboard,
//instanciate storyboard let mainstoryboard = uistoryboard(name:"storyboardname", bundle:nil) let myviewcontroller = mainstoryboard.instanciateviewcontrollerwithidentifier("viewcontrolleridentifier") as? viewcontroller1
you can set identifier in interface builder
Comments
Post a Comment