저는 신속한 답변을 드리고자합니다. 나는이 코드를 시도하고 빠른 3에서 URL의 데이터를 분석하려고 해요 :alamofire json parsing swift 3
Alamofire.request("https://jsonplaceholder.typicode.com/todos").responseJSON { response in
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
을 그리고 아래로 JSON을 가지고 :
JSON: (
{
completed = 0;
id = 1;
title = "delectus aut autem";
userId = 1;
},
{
completed = 0;
id = 2;
title = "quis ut nam facilis et officia qui";
userId = 1;
})
사람은 어떻게 모든 구문 분석하는 나를 도울 수 이 값을 사전 또는 배열에 저장하고이를 신속한 3 차원 테이블 뷰에 나타낼 수 있습니까? 여기
는
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return object.count
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return object.property.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
cell.textLabel?.text = property.[indexPath]
return cell
}
tableview
에arrayData
을 사용할 수 있습니다 당신에게'tableView' –단순한 테이블보기의 코드를 표시합니다. 값을 표시하기 위해 1 섹션에 4 행이 있습니다. 도와 주시면 고맙습니다. –
그런 다음 질문에 해당 코드를 추가하여 TableCell에 표시 할 정보를 선택하십시오. –