Skip to content

Latest commit

 

History

History
35 lines (31 loc) · 880 Bytes

8. TextView Custom PlaceHolder.md

File metadata and controls

35 lines (31 loc) · 880 Bytes

날짜: 2023-02-10 16:26

주제: TextView Custom PlaceHolder


메모:

  • Create textView
    private lazy var textView: UITextView = {
        let textView = UITextView()
        textView.delegate = self
        textView.font = .systemFont(ofSize: 16.0, weight: .medium)
        textView.text = "custom PlaceHolder"
        textView.textColor = .secondaryLabel
  
        return textView
    }()
  • Create textView Delegate (textViewDidBeginEditing)
extension ExView: UITextViewDelegate {
    func textViewDidBeginEditing(_ textView: UITextView) {
        guard textView.textColor == .secondaryLabel else { return }
        textView.text = nil
        textView.textColor = .label
    }
}

출처(참고문헌)

연결문서

  • [[3. UIText View (x)]]

Tag

  • #IOS/UIKit/TextView