I\'m trying to implement this design but all solutions I have browsed won\'t work and from what I understand it could be because of the spacing between the cells and the UIT
You have to make a UIView
inside UITableViewCell
and work on that view.
FOR SHADOW I AM USING THIS IN UITableViewCell
CLASS:-
viewDummy.addShadow() //use from any view
extension UIView {
func addShadow(){
self.layer.shadowColor = UIColor.blackColor().CGColor
self.layer.shadowOpacity = 0.5
self.layer.shadowRadius = 2.0
self.layer.shadowOffset = CGSizeMake(1.0, 1.0)
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.layer.shadowOffset = CGSize(width: 0, height: 0)
cell.layer.shadowColor = UIColor.black.cgColor
cell.layer.shadowRadius = 5
cell.layer.shadowOpacity = 0.40
cell.layer.masksToBounds = false;
cell.clipsToBounds = false;
return cell
}