Я хочу реализовать SEGUE/раскадровку в кнопки С точки зрения контроллера к контроллеру панели вкладок (Home) в быстром 3Раскадровка или переход от ViewController к TabBar Контроллер
Это мой знак в коде
@IBAction func LogIn(_ sender: Any) {
if self.emailTextfield.text == "" || self.passwordTextfield.text == "" {
let alertController = UIAlertController(title: "Error", message: "Please enter an email and password.", preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
} else {
FIRAuth.auth()?.signIn(withEmail: self.emailTextfield.text!, password: self.passwordTextfield.text!) { (user, error) in
if error == nil {
print("You have successfully logged in")
//this is my storyboard but it gives me black screen
let vc = self.storyboard?.instantiateViewController(withIdentifier: "Home")
self.present(vc!, animated: true, completion: nil)
} else {
let alertController = UIAlertController(title: "Error", message: error?.localizedDescription, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
}
}
}
}
Я попытался с помощью раскадровки
let vc = self.storyboard?.instantiateViewController(withIdentifier: "Home")
self.present(vc!, animated: true, completion: nil)
я попытался использовать segue
self.performSegue(withIdentifier: "Home", sender: self)
оба дает мне черный экран. Зачем? У меня есть разъяснение. где я должен подключить свой сеанс, находится ли он в контроллере панели вкладок (серый) или на первом контроллере TAB?
U необходимо создать класс TabBar для перехода от ViewController к TabBarcontroller –
Я уже создал HomeViewController.swift. Просто для того, чтобы укоротить мой вопрос: как segue (если использовать segue) или раскадровку (при использовании раскадровки) От контроллера представления до контроллера панели TAB? Я знаю, как переходить от контроллера просмотра к другому, но в панели вкладок я не знал. – Lonewulf
Я думаю, что вы создали новый класс под UITabBarController для Tabbar, Link - https://drive.google.com/file/d/0B1bdnxm63q27cE02dzNod2Yyd3M/view?usp=sharing –