MentionTextView.h 589 B

1234567891011121314151617181920212223
  1. //
  2. // MentionTextView.h
  3. // AIIM
  4. //
  5. // Created by qitewei on 2025/5/30.
  6. //
  7. #import <UIKit/UIKit.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @interface MentionTextView : UITextView
  10. @property (nonatomic, strong) NSArray<NSValue *> *mentionRanges;
  11. @property (nonatomic, copy) void (^mentionTapHandler)(NSString *mention);
  12. @property (nonatomic, copy) void (^mentionDeleteHandler)(NSString *deletedMention, NSUInteger originalIndex);
  13. - (void)setup;
  14. - (BOOL)deleteMentionAtCursorPosition;
  15. ///手动删除指定位置的@用户名
  16. - (void)deleteMentionAtIndex:(NSUInteger)index;
  17. @end
  18. NS_ASSUME_NONNULL_END