定义元组错误:预期','分隔符

时间:2015-09-20 07:14:17

标签: ios swift swift2

以下是代码:

var URLRequest: NSURLRequest {

        let (path: String, parameters: [String: AnyObject]) = {
        //Error: expected ',' seperator
        //Error: expected pattern

            switch self {

            //Three cases here. 

            }
        }()

        let URL = NSURL(string: Router.baseURLString)
        let URLRequest = NSURLRequest(URL: URL!.URLByAppendingPathComponent(path))
        //Error: use of unresolved identifier 'path'
        let encoding = Alamofire.ParameterEncoding.URL

        return encoding.encode(URLRequest, parameters: parameters).0
        //Error: use of unresolved identifier 'parameters' 
    }

显示了几个错误,但我认为所有错误都是由同一问题引起的。 代码升级到Swift 2.

0 个答案:

没有答案