title: Adding Bottom Line Border To A TextView - iOS
body: <p>what is the best way to add a bottom line border to a <code>TextView</code>?
  i have tried this but it seems it doesn't work. It is affected by the scrolling ability of the <code>textview</code> and the line is being drawn in the middle of the <code>TextView</code></p>
  
  <pre><code>func addBottomBorderWithColor(color: UIColor, width: CGFloat) {
          let border = CALayer()
          border.backgroundColor = color.CGColor
          border.frame = CGRectMake(0, self.frame.size.height - width, self.frame.size.width, width)
          self.layer.addSublayer(border)
          self.layer.masksToBounds = true
   }
  </code></pre>
  
  <p>Edit: 
  The TextView has a dynamic height.</p>