YISwipeShiftCaretios交互控件

联合创作 · 2023-09-27 04:24

适用于iOS的滑动到移动文本输入插入符号(无私有API)

示例代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // add swipe-shift-caret gestures to all of UITextField/UITextView
    [YISwipeShiftCaret install];

    //
    // or, you can implement gestures manually as follows, adding to non-textInput (wider parent) view:
    //
    // YISwipeShiftCaretGestureRecognizer* gesture = [[YISwipeShiftCaretGestureRecognizer alloc] initWithTextInput:self.textField];
    // [self.window addGestureRecognizer:gesture];

    return YES;
}

 

浏览 6
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报