You dont't load anything in PhoneNumberVC.
Where is the content of PhoneNumberVC defined ? In a nib file ?
You should instantiate nextVC from it.
In addition, you could simplify a little your code:
@objc func goNext() {
name = nametextField.text!
print("Name: \(name)")
// if nametextField.text?.isEmpty == false {
if !name.ismpty {
let nextVC = PhoneNumberVC() // That's a problem
nextVC.modalPresentationStyle = .fullScreen
//
present(nextVC, animated: true, completion: nil)
} else {
print("No valid name")
}
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: