键盘添加撤销操作
This commit is contained in:
29
CustomKeyboard/Utils/KBBackspaceUndoManager.h
Normal file
29
CustomKeyboard/Utils/KBBackspaceUndoManager.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// KBBackspaceUndoManager.h
|
||||
// CustomKeyboard
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSNotificationName const KBBackspaceUndoStateDidChangeNotification;
|
||||
|
||||
@interface KBBackspaceUndoManager : NSObject
|
||||
|
||||
@property (nonatomic, readonly) BOOL hasUndo;
|
||||
|
||||
+ (instancetype)shared;
|
||||
|
||||
/// 记录一次“立刻清空”删除的内容(基于 documentContextBeforeInput)
|
||||
- (void)recordClearWithContext:(NSString *)context;
|
||||
|
||||
/// 在指定 responder 处执行撤销(向光标处插回删除的内容)
|
||||
- (void)performUndoFromResponder:(UIResponder *)responder;
|
||||
|
||||
/// 非清空行为触发时,清理撤销状态
|
||||
- (void)registerNonClearAction;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user