Skip to content

Commit

Permalink
development: combining TextView with Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Mar 8, 2017
1 parent 689efbd commit fa08e44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/iOS/Editor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ open class Editor: View {
}

/// Reference to the TextView.
open fileprivate(set) var textView: UITextView!
open fileprivate(set) var textView: TextView!

/// A reference to an EditorDelegate.
open weak var delegate: EditorDelegate?
Expand Down Expand Up @@ -312,7 +312,7 @@ extension Editor {

/// Prepares the textView.
fileprivate func prepareTextView() {
textView = UITextView(frame: .zero, textContainer: textContainer)
textView = TextView(textContainer: textContainer)
textView.delegate = self
addSubview(textView)
}
Expand Down
9 changes: 9 additions & 0 deletions Sources/iOS/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ open class TextView: UITextView {
preparePlaceholderLabel()
}
}

open var placeholder: String? {
get {
return placeholderLabel?.text
}
set(value) {
placeholderLabel?.text = value
}
}

/// An override to the text property.
@IBInspectable
Expand Down

0 comments on commit fa08e44

Please sign in to comment.