Last active
June 11, 2020 07:56
-
-
Save monsoir/ae348c58580818730683c44de89403de to your computer and use it in GitHub Desktop.
Swift 参数数量可变函数
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
// https://stackoverflow.com/a/24035942 | |
func foo(args:AnyObject...) { | |
for arg: AnyObject in args { | |
println(arg) | |
} | |
} | |
foo(5, "bar", NSView()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment