Skip to content

Instantly share code, notes, and snippets.

@monsoir
Last active June 11, 2020 07:56
Show Gist options
  • Save monsoir/ae348c58580818730683c44de89403de to your computer and use it in GitHub Desktop.
Save monsoir/ae348c58580818730683c44de89403de to your computer and use it in GitHub Desktop.
Swift 参数数量可变函数
// 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