Я использую CollectionViewFlowLayout для динамического изменения размеров ячеек CollectionView до размеров экрана; однако при попытке изменить свойства border / shadow / et c ячеек я получаю результаты, отличные от ожидаемых. Какой слой я должен редактировать, чтобы адресовать правильный вид для изменения?
Что я получаю до изменения свойств ячейки по сравнению с тем, что я получаю после вызова layoutSubviews (): 
//in ViewController
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let noOfCellsInRow = 2
let flowLayout = collectionViewLayout as! UICollectionViewFlowLayout
let totalSpace = flowLayout.sectionInset.left
+ flowLayout.sectionInset.right
+ (flowLayout.minimumInteritemSpacing * CGFloat(noOfCellsInRow - 1))
let size = Int((collectionView.bounds.width - totalSpace) / CGFloat(noOfCellsInRow))
return CGSize(width: size, height: size)
}
class PlacesCollectionViewCell: UICollectionViewCell {
override func layoutSubviews() {
self.layer.cornerRadius = 10.0
self.layer.borderWidth = 1.0
self.layer.borderColor = UIColor.red.cgColor
self.layer.masksToBounds = true
self.contentView.layer.cornerRadius = 15.0
self.contentView.layer.borderWidth = 5.0
self.contentView.layer.borderColor = UIColor.yellow.cgColor
self.contentView.layer.masksToBounds = true
self.layer.shadowColor = UIColor.white.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 0.0)
self.layer.shadowRadius = 2.0
self.layer.shadowOpacity = 0.6
self.layer.cornerRadius = 2.0
self.layer.masksToBounds = false
self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius:
self.contentView.layer.cornerRadius).cgPath
}
}