diff --git a/guide/spanish/swift/functions/index.md b/guide/spanish/swift/functions/index.md index 62e34bbb88..4b2df13311 100644 --- a/guide/spanish/swift/functions/index.md +++ b/guide/spanish/swift/functions/index.md @@ -4,12 +4,24 @@ localeTitle: Funciones --- ## Funciones -Las funciones en Swift consisten en un parámetro y un tipo de retorno. Las funciones se pueden crear utilizando esta estructura básica: \`\` \`Swift func sayHello (nameOfPerson: String) -> String { let hola = "Hola," + nameOfPerson + "." imprimir (hola) } +Las funciones en Swift consisten en un parámetro y un tipo de retorno. Las funciones se pueden crear utilizando esta estructura básica: + ```Swift + func sayHello(nameOfPerson: String) -> String { + let hello = "Hola," + nameOfPerson + "." + print(hello) + } -sayHello (nameOfPerson: "Steve") ` `` In this example, the function sayHello takes in a string name and prints out the phrase` "Hola, Steve". + sayHello(nameOfPerson: "Steve") + ``` +En este ejemplo, la función sayHello coge una cadena de palabras e imprime la frase `"Hola, Steve."`. ## Parámetros de función -Las funciones no requieren ningún parámetro de entrada o tipo de retorno. Sin embargo, esto requiere los paréntesis después de nombrar las funciones. \`\` \`Swift func helloSteve () { imprimir ("Hola, Steve") } - -helloSteve () // Esto imprime "Hola, Steve". \`\` \` \ No newline at end of file +Las funciones no requieren ningún parámetro de entrada o tipo de retorno. Sin embargo, esto requiere los paréntesis después de nombrar las funciones. + ```Swift + func helloSteve() { + print("Hola, Steve.") + } + + helloSteve() // Esto imprime "Hola, Steve." + ```