I'm getting one issue with UICollectionView
Cell
. i'm try to give only 2 side corner radius to UIView
with below code. i face below issue. Any suggestion could be appreciate. Thank you
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell : FeaturedCell = collectionView.dequeueReusableCell(withReuseIdentifier: "FeaturedCell", for: indexPath) as! FeaturedCell
let objModel = arrSearch[indexPath.row]
cell.lblproducttitle.text = "\(objModel.Name!) \n$\(objModel.price!)"
cell.imgproduct.sd_setImage(with: URL(string: objModel.imgUrl), placeholderImage: UIImage(named: "logo"), options: .refreshCached, completed: nil)
let mask = CAShapeLayer()
mask.bounds = cell.productnamevw.frame
mask.position = cell.productnamevw.center
mask.backgroundColor = cell.productnamevw.backgroundColor?.cgColor
let path = UIBezierPath(roundedRect: cell.productnamevw.bounds, byRoundingCorners: [.bottomLeft , .bottomRight], cornerRadii: CGSize(width: 10, height: 10))
mask.path = path.cgPath
cell.productnamevw.layer.mask = mask
cell.productnamevw.layer.masksToBounds = true
return cell
}