Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 在Swift 3函数中返回数组中的多个数组_Arrays_Swift_Function_Swift3 - Fatal编程技术网

Arrays 在Swift 3函数中返回数组中的多个数组

Arrays 在Swift 3函数中返回数组中的多个数组,arrays,swift,function,swift3,Arrays,Swift,Function,Swift3,我对数组中的返回值有疑问 var data = [[Int](),[Int]()] 如何在函数中返回数据 func test() ->[[Int](),[Int]()] // this giving me error { } 如何在Swift中返回单个数组中的多个数组?类型为[[Int](),[Int]()]的类型为[[Int]](与数组相同), i、 e.其元素为Int数组的数组: func test() -> [[Int]] { let data = [[Int](

我对数组中的返回值有疑问

var data = [[Int](),[Int]()]
如何在函数中返回数据

func test() ->[[Int](),[Int]()] // this giving me error {

}
如何在Swift中返回单个数组中的多个数组?

类型为
[[Int](),[Int]()]
的类型为
[[Int]]
(与
数组
相同), i、 e.其元素为
Int
数组的数组:

func test() -> [[Int]] {
    let data = [[Int](),[Int]()]
    return data
}

fun test()->[[Int]]{}返回一个touple怎么样<代码>函数测试()->([Int],[Int]){}