Created
January 2, 2016 03:18
-
-
Save monmon/e83f5b8a2e1943ddebd3 to your computer and use it in GitHub Desktop.
Swift Variadic Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func variadic(items: Any...) { | |
print(items.joinWithSeparator(" = ")) // 何も表示されない | |
print(items.map({ String($0) }).joinWithSeparator(" = ")) // a = b | |
} | |
variadic("a", "b") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment