I guess I got down voted for Obj C code, here's the swift version:
func viewDidAppear(){
super.viewDidAppear()
passwordField.becomeFirstResponder()
}