   @IBOutlet var passwordTextField: UITextField!
   @IBOutlet var confirmPasswordTextField: UITextField!
   
+  var meteor: MeteorClient!
+  
+  override func viewWillAppear(animated: Bool) {
+    super.viewWillAppear(animated)
+    let ad = UIApplication.sharedApplication().delegate as! AppDelegate
+    meteor = ad.meteorClient
+    
+  }
+
   
   override func viewDidLoad() {
     super.viewDidLoad()

    else
    {
      
        
        }
      
        
        
        
        //User is automatically is added to CoreData, but not saved, so we need to call
        //save context next.

        })
        
        
        //Proceed to username selection screen.
        self.performSegueWithIdentifier("selectUsername", sender: self)
        
      }
    }
    
  }
  
  func handleFailedReg(error: NSError){
    //Inform the not-registered user
    let alert = UIAlertView(title: "Name Exists", message: "Username not available", delegate: self, cancelButtonTitle: "Dismiss")
    alert.show()

  }
  
  
