add shadow to collection view cell swift
self.contentView.layer.cornerRadius = 2.0
self.contentView.layer.borderWidth = 1.0
self.contentView.layer.borderColor = UIColor.clear.cgColor
self.contentView.layer.masksToBounds = true
self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 2.0)
self.layer.shadowRadius = 2.0
self.layer.shadowOpacity = 0.5
self.layer.masksToBounds = false
self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: self.contentView.layer.cornerRadius).cgPath
Also in Swift:
- add shadow to collection view cell swift
- swift has Top Notch
- How to initialize data in Preview provider in SwiftUI
- array swift
- swift set uiimage color
- get address from latitude and longitude in swift
- rotate image animated swift
- chating App in swift
- stack view xcode
- how to recieve hex value from NSData swift
- swift constraint center vertically
- swift subtract dates
- prevent iphone to sleep swift
- get device name swift
- how to add an underline to a textField swift
- swift doc comments
- create dictionary swift
- swift 5 progress bar height
- how to know when text changed textfield swiftui
- swift animate add subview
- swift filter dictionary
- swift change enum value
- how do i have countdown timer in swift stackoverflow
- pop the view controller xcode