I am trying to shrink the size of the icons that are displayed in each cell. The code I am trying to use is:
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! UITableViewCell
let cellIcon = UIImage(named: tableIcons[indexPath.row])
cell.imageView!.frame = CGRect(x: cell.imageView!.frame.origin.x, y: cell.imageView!.frame.origin.y, width: cell.imageView!.frame.size.width / 2, height: cell.imageView!.frame.size.height / 2)
cell.imageView!.image = cellIcon
cell.imageView?.contentMode = UIViewContentMode.ScaleAspectFill
return cell
I would have thought this would shrink the imageview by half and have the image scale to fill the now halved view. But the image in the cells stay the same size. Am I going about this problem correctly?