Skip to content

Instantly share code, notes, and snippets.

View IBM9100's full-sized avatar
🍉

IBM9100

🍉
  • Bytedance
  • Shenzhen⭐
View GitHub Profile
@IBM9100
IBM9100 / shadow+cornerradius.swift
Created July 15, 2017 11:44 — forked from nor0x/shadow+cornerradius.swift
UICollectionViewCell -> Corner Radius AND Shadow
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
cell.contentView.layer.cornerRadius = 2.0
cell.contentView.layer.borderWidth = 1.0
cell.contentView.layer.borderColor = UIColor.clear.cgColor
cell.contentView.layer.masksToBounds = true;
cell.layer.shadowColor = UIColor.lightGray.cgColor
cell.layer.shadowOffset = CGSize(width:0,height: 2.0)
cell.layer.shadowRadius = 2.0
cell.layer.shadowOpacity = 1.0