0
我找不到任何解決方案,您可以請幫我...URLSession.shared.dataTask(......)不工作
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath)
let user = users[indexPath.row]
cell.textLabel?.text = user.name
cell.imageView?.image = UIImage(named: "lukas")
if let profileImageURL = user.profileImageURL {
var url = NSURL(string: profileImageURL)
URLSession.shared.dataTask(with: url!, completionHandler: { (data, response, error) in
if error != nil {
print(error)
return
}
})
}
return cell
}