[Swift Language Guide] ํจ์(Functions)
Swift Language Guide
2023. 5. 24. 19:12
Functions With an Implicit Return func greeting(for person: String) -> String { "Hello, " + person + "!" } ์ ์ฒด ๋ณธ๋ฌธ์ด ํ์ค๋ก ํํ์ด ๋๋ค๋ฉด returnํค์๋ ์๋ต ๊ฐ๋ฅ Specifying Argument Labels func greet(person: String, from hometown: String) -> String { return "Hello \\(person)! Glad you could visit from \\(hometown)." } print(greet(person: "Bill", from: "Cupertino")) ํจ์ ๋ด๋ถ์์ ์ฌ์ฉํ ์ธ์ ์ด๋ฆ ์ง์ ์ด ๊ฐ๋ฅํ๋ค. ๊ฐ๋ณ ํ๋ผ๋ฏธํฐ (Variadic Para..