SHARE
TWEET

Untitled

a guest Sep 16th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Cell
  2. final class CircleCell: UICollectionViewCell {
  3.     @IBOutlet private weak var circleView: UIView!
  4.    
  5.     func setCircleView() {
  6.         layoutIfNeeded() // Without this, it doesn't draw a circle correctly.
  7.         circleView.layer.cornerRadius = circleView.frame.width / 2
  8.     }
  9. }
  10.  
  11. // DataSouce
  12. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  13.     let cell = collectionView.dequeueReusableCell...
  14.     cell.setCircleView()
  15.     return cell
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top