Skip to content

Commit

Permalink
Added conformance to UITextInput for EditorView
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeep committed Nov 16, 2024
1 parent 2a0f76e commit b304c54
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Proton/Sources/Swift/Editor/EditorView+UITextInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,3 @@ extension EditorView: UITextInput {
richTextView.insertText(text)
}
}

@propertyWrapper
struct RichTextViewProperty<T> {
private weak var textView: RichTextView?
private let keyPath: ReferenceWritableKeyPath<UITextView, T>

init(_ textView: RichTextView, keyPath: ReferenceWritableKeyPath<UITextView, T>) {
self.textView = textView
self.keyPath = keyPath
}

var wrappedValue: T {
get {
return textView?[keyPath: keyPath] ?? (T.self as! T)
}
set {
textView?[keyPath: keyPath] = newValue
}
}
}

0 comments on commit b304c54

Please sign in to comment.