๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป iOSun
article thumbnail
[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..

profile on loading

Loading...