您的位置:首页 > 其它

CoreTFManagerVC 强大的键盘躲避管理器,完全解耦版本!

2015-09-19 19:02 465 查看
在iOS 中都会遇到 键盘挡住输入框的情况,这时就可以用到CoreTFManagerVC 键盘管理器了

下载链接:https://github.com/CharlinFeng/CoreTFManagerVC



框架特性:

向下兼容到ios 6.0.

.完全解耦,不需要继承,不需要定义成员属性,类方法直接搞定一切。

.自动管理生命周期,你只需要使用即可,不需要管理控制器的生命周期。本框架效仿百度地图的生命周期管理方案,后面使用会详细说明,此方案最合理。

.支持普通视图,新版本主要是解耦以及增加scrollView的支持。

.支持自定义键盘。自动placeHolder处理。

block封装,不需要任何代理,甚至你连键盘躲避管理器的对象实例都看不到。

.scrollView支持contentInset。

.支持所有设备,包括横竖屏。

.封装了强大的键盘工具条,不需要再担心屏幕小不好切换或者退下键盘了。

.做了比较多的性能优化,最大必的提高性能。

.完善的错误处理机制。

.完善的动画效果及不同键盘切换动画效果,动画曲线效果。

.insetsBottom表示这个文本输入框是否需要向下多留一点空白,一般是文本框下面有提示类文字或者提交类按钮可以设置此值。 .完善的内存管理。

使用很简单的

//安装:请在viewDidAppear中完成
-(void)viewDidAppear:(BOOL)animated{

[super viewDidAppear:animated];

[CoreTFManagerVC installManagerForVC:self scrollView:self.scrollView tfModels:^NSArray *{
UIDatePicker *picker=[[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 200)];

TFModel *tfm1=[TFModel modelWithTextFiled:_tf1 inputView:nil name:@"tf1" insetBottom:0];
TFModel *tfm2=[TFModel modelWithTextFiled:_tf2 inputView:picker name:@"tf2" insetBottom:0];
TFModel *tfm3=[TFModel modelWithTextFiled:_tf3 inputView:nil name:@"tf3" insetBottom:30];
TFModel *tfm4=[TFModel modelWithTextFiled:_tf4 inputView:nil name:@"tf4" insetBottom:0];
TFModel *tfm5=[TFModel modelWithTextFiled:_tf5 inputView:nil name:@"tf5" insetBottom:0];
TFModel *tfm6=[TFModel modelWithTextFiled:_tf6 inputView:nil name:@"tf6" insetBottom:0];

return @[tfm1,tfm2,tfm3,tfm4,tfm5,tfm6];

}];
}

//卸载:请在viewDidDisappear中完成
-(void)viewDidDisappear:(BOOL)animated{

[super viewDidDisappear:animated];

[CoreTFManagerVC uninstallManagerForVC:self];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: