I have a navigation display controller, which after the action sends segue to the display controller of the tab bar. Because of this, the segue tabbed controller displays a navigation bar. I am trying to apply a title to one of my view controllers attached to a tab bar view controller, but setting the title through code does not work for me. Does anyone know the reason why this could be?
Here is a photo of my storyboard:

The view controller with the logout button is where I try to set the title in the navigation bar (code):
import UIKit
class ProfileSettingsViewController: UIViewController {
override func viewWillAppear(animated: Bool) {
self.navigationItem.title = "Profile Settings"
}
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.leftBarButtonItem = nil
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func logoutButton(sender: AnyObject) {
PFUser.logOut()
var currentUser = PFUser.currentUser()
self.performSegueWithIdentifier("userLoggedOut", sender: self)
self.navigationController?.setNavigationBarHidden(self.navigationController?.navigationBarHidden == false, animated: true)
}
}
View the controller built into the navigation controller that launches segue in the controller of the tab bar:
import UIKit
class UserRegistrationViewController: UIViewController {
func displayAlert(title:String, error:String) {
var alert = UIAlertController(title: title, message: error, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: {
action in
}))
self.presentViewController(alert, animated: true, completion: nil)
}
@IBOutlet var usernameTextField: UITextField!
@IBOutlet var emailTextField: UITextField!
@IBOutlet var passwordTextField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func registerUser(sender: AnyObject) {
var error = ""
if usernameTextField.text == nil || emailTextField.text == nil || passwordTextField.text == nil {
error = "Please enter a username, email and password"
}
if error != "" {
displayAlert("Error In Form", error: error)
} else {
var user = PFUser.currentUser()
user.username = usernameTextField.text
user.password = passwordTextField.text
user.email = emailTextField.text
user.saveInBackgroundWithBlock {
(succeeded: Bool!, signupError: NSError!) -> Void in
if signupError == nil {
println(user.username)
println(user.password)
println(user.email)
self.performSegueWithIdentifier("successfulRegistration", sender: self)
self.navigationController?.setNavigationBarHidden(self.navigationController?.navigationBarHidden == false, animated: true)
} else {
if let errorString = signupError.userInfo?["error"] as? NSString {
error = errorString
} else {
error = "Please try again later."
}
self.displayAlert("Could Not Sign Up", error: error)
}
}
}
}
}