title: Swift shadow on tableview with dynamic content
body: <p>I have a problem with dynamic content with shadow on table view</p>
  
  <p>I had an extension for make corner radius and make shadow</p>
  
  <pre><code>extension UIView {
  
  func roundCorners(_ corners: UIRectCorner, radius: CGFloat) {
      let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
      let mask = CAShapeLayer()
      mask.path = path.cgPath
  
      self.layer.mask = mask
  
      let shadowLayer = CAShapeLayer()
      shadowLayer.path = path.cgPath
      shadowLayer.frame = self.frame
  
      shadowLayer.shadowOpacity = 0.4
      shadowLayer.shadowRadius = 2
      shadowLayer.shadowColor = UIColor.black.cgColor
      shadowLayer.shadowOpacity = 0.13
      shadowLayer.shadowRadius = 6
      shadowLayer.shadowOffset = CGSize(width: 0, height: 3)
  
      self.superview!.layer.insertSublayer(shadowLayer, below: self.layer)
      }
  }
  </code></pre>
  
  <p>And This id MyCustomTableViewCell</p>
  
  <pre><code>override func awakeFromNib() {
      super.awakeFromNib()
  
      bg_view.roundCorners([.topLeft, .topRight, .bottomRight, .bottomLeft], radius: 9)
  }
  </code></pre>
  
  <p>And This My result (text is "this is my data on table") </p>
  
  <p><a href="https://i.stack.imgur.com/Maeg7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Maeg7.jpg" alt="My current re sult"></a></p>
  
  <p>I also use</p>
  
  <pre><code>activity_table.rowHeight = UITableView.automaticDimension
  activity_table.estimatedRowHeight = 100
  </code></pre>
  
  <p>And Set line to 0</p>