Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alamofire新版本request方法参数变化 #7

Open
narakai opened this issue Jan 14, 2016 · 0 comments
Open

Alamofire新版本request方法参数变化 #7

narakai opened this issue Jan 14, 2016 · 0 comments

Comments

@narakai
Copy link

narakai commented Jan 14, 2016

闭包的三个参数变为一个,修改为下面的代码编译运行OK:

Alamofire.request(.GET, "http://news-at.zhihu.com/api/4/themes").responseJSON { response in
guard response.result.error == nil else {
print("获取数据失败")
return
}
let data = JSON(response.result.value!)["others"]
for i in 0 ..< data.count {
self.themes.append(ThemeModel(id: String(data[i]["id"]), name: data[i]["name"].string!))
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant