In my case, sending selectAll(_:) did not work right after calling becomeFirstResponder .
I worked around it, expecting one runloop:
Swift 2:
dispatch_async(dispatch_get_main_queue()) { UIApplication.sharedApplication().sendAction(#selector(UITextField.selectAll(_:)), to: nil, from: nil, forEvent: nil) }
Swift 3:
DispatchQueue.main.async(execute: { UIApplication.sharedApplication().sendAction(#selector(UITextField.selectAll(_:)), to: nil, from: nil, forEvent: nil) })
source share