This is the way it works and you can touch wherever you want in the view in order to deselect the previously selected text:
On your UIViewController write this function:
override func touchesBegan(touches: Set, withEvent event: UIEvent?) {
self.view.endEditing(true)
}