Ich habe einen TabBarController mit 5 ViewControllern, auf einem der ViewControllers habe ich eine Reihe von Tasten, die verschiedene View Controller außerhalb des TabBarControllers laden. Diese werden geladen, obwohl die Modal Segue jedoch das Problem, das ich habe, ist, wenn ich versuche, um die Ansicht zu gehen zurück in der Tab Bar lädt es aber ohne die Tab-Leiste selbst, der Code, den ich habe, ist:Zurück zu einer Ansicht in einem Tab Bar Controller Programmatisch
class GreetingsVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func goBack(sender: AnyObject) {
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextViewController = storyBoard.instantiateViewControllerWithIdentifier("anonScreen") as! AnonVC
self.presentViewController(nextViewController, animated:true, completion:nil)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
Wie kann ich es so machen, wenn die Zurück-Taste gedrückt wird, präsentiert es den View-Controller vom Tab-Bar-Controller?
Try 'self.tabBarController.presentViewController zu tun (nextViewController, animiert: true, Abschluss: null)' statt 'self.presentViewController (nextViewController, animiert: true, Abschluss: null)' – Randy
Nö, noch lädt die Ansicht ohne Tabulator bei t er bottom :( – Konsy