| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector(UITextViewDelegate.textViewShouldBeginEditing(_:))) { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector((any UITextViewDelegate).textViewShouldBeginEditing(_:))) { |
| | | return unwrapDelegate.textViewShouldBeginEditing?(textView) ?? false |
| | | } |
| | | } |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector(UITextViewDelegate.textViewShouldEndEditing(_:))) { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector((any UITextViewDelegate).textViewShouldEndEditing(_:))) { |
| | | return unwrapDelegate.textViewShouldEndEditing?(textView) ?? false |
| | | } |
| | | } |
| | |
| | | @objc public func textViewDidBeginEditing(_ textView: UITextView) { |
| | | updateReturnKeyTypeOnTextField(textView) |
| | | |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | @objc public func textViewDidEndEditing(_ textView: UITextView) { |
| | | |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | let selector: Selector = #selector(UITextViewDelegate.textView(_:shouldChangeTextIn:replacementText:)) |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(textView)?.textViewDelegate { |
| | | let selector = #selector((any UITextViewDelegate).textView(_:shouldChangeTextIn:replacementText:)) |
| | | if unwrapDelegate.responds(to: selector) { |
| | | isReturn = (unwrapDelegate.textView?(textView, |
| | | shouldChangeTextIn: range, |
| | |
| | | |
| | | @objc public func textViewDidChange(_ textView: UITextView) { |
| | | |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | @objc public func textViewDidChangeSelection(_ textView: UITextView) { |
| | | |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | let selector: Selector = #selector(textView as |
| | | (UITextView, URL, NSRange, UITextItemInteraction) -> Bool) |
| | | if unwrapDelegate.responds(to: selector) { |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | let selector: Selector = #selector(textView as |
| | | (UITextView, NSTextAttachment, NSRange, UITextItemInteraction) |
| | | -> Bool) |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector(textView as (UITextView, URL, NSRange) -> Bool)) { |
| | | return unwrapDelegate.textView?(aTextView, |
| | | shouldInteractWith: URL, |
| | |
| | | |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if unwrapDelegate.responds(to: #selector(textView as (UITextView, NSTextAttachment, NSRange) -> Bool)) { |
| | | return unwrapDelegate.textView?(aTextView, |
| | | shouldInteractWith: textAttachment, |
| | |
| | | suggestedActions: [UIMenuElement]) -> UIMenu? { |
| | | if delegate == nil { |
| | | |
| | | if let unwrapDelegate: UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | if let unwrapDelegate: any UITextViewDelegate = textFieldViewCachedInfo(aTextView)?.textViewDelegate { |
| | | |
| | | let selector: Selector = #selector(textView as |
| | | (UITextView, NSRange, [UIMenuElement]) -> UIMenu?) |
| | |
| | | return nil |
| | | } |
| | | |
| | | public func textView(_ aTextView: UITextView, willPresentEditMenuWith animator: UIEditMenuInteractionAnimating) { |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | public func textView(_ aTextView: UITextView, |
| | | willPresentEditMenuWith animator: any UIEditMenuInteractionAnimating) { |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | aDelegate?.textView?(aTextView, willPresentEditMenuWith: animator) |
| | | } |
| | | |
| | | public func textView(_ aTextView: UITextView, willDismissEditMenuWith animator: UIEditMenuInteractionAnimating) { |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | public func textView(_ aTextView: UITextView, |
| | | willDismissEditMenuWith animator: any UIEditMenuInteractionAnimating) { |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | public func textView(_ textView: UITextView, |
| | | textItemMenuWillDisplayFor textItem: UITextItem, |
| | | animator: UIContextMenuInteractionAnimating) { |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | animator: any UIContextMenuInteractionAnimating) { |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |
| | |
| | | |
| | | public func textView(_ textView: UITextView, |
| | | textItemMenuWillEndFor textItem: UITextItem, |
| | | animator: UIContextMenuInteractionAnimating) { |
| | | var aDelegate: UITextViewDelegate? = delegate |
| | | animator: any UIContextMenuInteractionAnimating) { |
| | | var aDelegate: (any UITextViewDelegate)? = delegate |
| | | |
| | | if aDelegate == nil { |
| | | |