             self.heightConstraint!.constant = height;
             scrollRangeToVisible(NSMakeRange(0, 0))
             if let delegate = delegate as? GrowingTextViewDelegate {
-                delegate.textViewDidChangeHeight?(height)
+                delegate.textViewDidChangeHeight?(height: height)
             }
         }
     }
     
     // Show placeholder
-    override public func drawRect(rect: CGRect) {
-        super.drawRect(rect)
+    override public func draw(_ rect: CGRect) {
+        super.draw(rect)
         if text.isEmpty {
             guard let placeHolder = placeHolder else { return }
             guard let placeHolderColor = placeHolderColor else { return }
             let paragraphStyle = NSMutableParagraphStyle()
             paragraphStyle.alignment = textAlignment
             
-            let rect = CGRectMake(textContainerInset.left + placeHolderLeftMargin,
-                textContainerInset.top,
-                frame.size.width - textContainerInset.left - textContainerInset.right,
-                frame.size.height)
+            let rect = CGRect(x: textContainerInset.left + placeHolderLeftMargin,
+                              y: textContainerInset.top,
+                              width:   frame.size.width - textContainerInset.left - textContainerInset.right,
+                              height: frame.size.height)
             
             var attributes = [
                 NSForegroundColorAttributeName: placeHolderColor,

    
    // Listen to UITextView notification to handle trimming, placeholder and maximum length
    private func commonInit() {
    
        self.contentMode = .Redraw
    
        NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(textDidChange), name: UITextViewTextDidChangeNotification, object: self)
        NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(textDidEndEditing), name: UITextViewTextDidEndEditingNotification, object: self)
    }
    
    // Remove notification observer when deinit
    deinit {
        NSNotificationCenter.defaultCenter().removeObserver(self)
    }
    
    // Calculate height of textview
    override public func layoutSubviews() {
        super.layoutSubviews()
        let size = sizeThatFits(CGSizeMake(bounds.size.width, CGFloat.max))
        var height = size.height
        if maxHeight > 0 {
            height = min(size.height, maxHeight)
        }
    
        if (heightConstraint == nil) {
            heightConstraint = NSLayoutConstraint(item: self, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: height)
            addConstraint(heightConstraint!)
        }
        

    public var placeHolderLeftMargin: CGFloat = 5 {
        didSet { setNeedsDisplay() }
    }
    
    private weak var heightConstraint: NSLayoutConstraint?
    
    // Initialize
    override public init(frame: CGRect, textContainer: NSTextContainer?) {
        super.init(frame: frame, textContainer: textContainer)
