Skip to content

Instantly share code, notes, and snippets.

@fitomad
Last active August 24, 2016 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/db8afc0d5437b40fdc6221abcd93c39e to your computer and use it in GitHub Desktop.
Save fitomad/db8afc0d5437b40fdc6221abcd93c39e to your computer and use it in GitHub Desktop.
//
// Definiendo el callback como tipo
//
typedef ResultCompletionHandler = (mensaje: String, tipo: String) -> (Void)
//
// Definido en la declaración del método
//
func findString(texto: String, completionHandler: (mensaje: String, tipo: String) -> (Void)) -> Void
{
// ... hacemos cosas
completionHandler(mensaje: "Ejemplo", tipo: "String")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment