     
     override func viewDidLoad() {
         super.viewDidLoad()
+        
+        NSNotificationCenter.defaultCenter().postNotificationName("loggedIn", object: nil)
         
         var currentUser = PFUser.currentUser()
         if currentUser != nil {

        var usrEntered = txtUsername.text
        var pwdEntered = txtPassword.text
        
        func userLogIn(){
            PFUser.logInWithUsernameInBackground(usrEntered, password:pwdEntered) {
                (user: PFUser!, error: NSError!) -> Void in
                if user != nil {
                    self.txtIncompleteFieldsMessage.text = "Log in successful."
                    self.dismissViewControllerAnimated(true, completion: nil)
                } else {
                    self.txtIncompleteFieldsMessage.text = "Log in failed. Please try again."
                }

        
    }
    
    @IBAction func signupTapped(sender: UIButton) {
        let vc = self.storyboard?.instantiateViewControllerWithIdentifier("SignupVC") as SignupVC
        self.navigationController?.pushViewController(vc, animated: true)
    }
}


