iOS textFiled 在storyBoard中的使用

step 1.

在UITableViewCotroller的xib中设置一个静态表格,在Utilities里选择属性检查器(第四个啦)设置属性,content : static cells、 style:groups.

step 2.

在静态表格里放一个UITextFiled,设置好它的样式。

step 3.

按住Ctrl键,将UITextFiled 连线到TableViewCtrl.选择Delegate.(我就忘过,结果懵逼半天)。

step 4.

可以新建一组UITableViewController文件, textFileViewController.m选择 SB的对应xib,并在文件检查器里(第三个啦),关联对应的文件。

step 5.

在textFileViewController.m建立一个无名分类(如果没有的话),然后遵守协议<UITextFiledDelegate>

step 6.

- (BOOL)textFieldShouldReturn:(UITextField *)textField{}写自己 输入结束时的处理逻辑吧。

如:[textField resignFirstResponder];

原文地址:https://www.cnblogs.com/wjw-blog/p/5629495.html