Я пытаюсь создать круглые изображения внутри моего TableViewCell, но что-то идет не так. Я думаю, что cornerRadius слишком большой, потому что с этим кодом не отображается ни одно изображение. Если я, например, установлю значение cornerRadius на 30, я могу видеть изображения округленными, но не в виде четкого круга. Почему это не работает?
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCell(withIdentifier: "QuestionLine")
cell = UITableViewCell(style: .subtitle, reuseIdentifier: "QuestionLine")
let user = users[indexPath.row]
cell?.textLabel?.text = user.question
cell?.detailTextLabel?.text = user.name
let image = UIImage(named: user.profilePicture)
cell?.imageView?.image = image
cell?.imageView?.layer.cornerRadius = (image?.size.width)! / 2
cell?.imageView?.clipsToBounds = true
return cell!
}