美文网首页
iOS 自定义安全键盘

iOS 自定义安全键盘

作者: 木子李55 | 来源:发表于2022-12-26 18:10 被阅读0次
    文末附有demo地址

    效果图

    效果图.gif

    使用方式

    可以通过pod导入,也可以下载demo后把LYSafeKeyboard文件夹导入。

    pod 'LYSafeKeyboard', '~> 0.0.3'
    
    如果pod repo update后还pod search不到,可以运行如下命令清下缓存后应该就可以了。
    rm ~/Library/Caches/CocoaPods/search_index.json
    
    在使用的控制器中,
    
    遵守<LYSafeTextFieldDelegate>
        
    LYSafeTextField *tf = [[LYSafeTextField alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
    tf.center = self.view.center;
    tf.backgroundColor = [UIColor whiteColor];
    tf.safeDelegate = self;
    [self.view addSubview:tf];
        
    #pragma mark - 输入框回调事件
    - (void)textFiledChangedWithText:(NSString *)text{
        NSLog(@"输入框内容 == %@", text);
    }
    

    demo下载https://github.com/zhuzi55/LYSafeKeyboard.git

    如对您有帮助,还请star一下。

    相关文章

      网友评论

          本文标题:iOS 自定义安全键盘

          本文链接:https://www.haomeiwen.com/subject/bxwnqdtx.html