extension SendOfferVC : UITextViewDelegate {
func textViewDidBeginEditing(_ textView: UITextView) {
if textView.text == "Add a Description to your Offer" {
textView.text = ""
textView.textColor = UIColor.darkGray
}
}
func textViewShouldEndEditing(_ textView: UITextView) -> Bool {
if textView.text == "" {
textView.text = "Add a Description to your Offer"
textView.textColor = UIColor.lightGray
}
return true
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
if(text == "\n") {
textView.resignFirstResponder()
return false
}
return true
}
}