I want to create a method that takes in one or more parameters but when I try the following code I get the following error message.
struct SomeStruct {
static func method(arrays: AnyObject[]...) -> AnyObject[] {
return []
}
}
SomeStruct.method([1], [2])
Cannot convert the expression's type 'AnyObject[]' to type 'IntegerLiteralConvertible'
If I run the following code
SomeStruct.method(["1"], ["2"])
I get the following error
Cannot convert the expression's type 'AnyObject[]' to type 'ExtendedGraphemeClusterLiteralConvertible'
I want to allow 0 or more array of items to be passed into this method of any element type including numbers. How can I do this?
