TextField跳转视图控制器

1,设置输入框的Enable属性为YES,关闭其他traits属性,保证点击textfield的时候不会弹出输入框

2,textfield设置成属性,viewdidload里设置代理,遵循<UITextFieldDelegate>协议

3,调用-(BOOL)textFieldShouldBeginEditing:方法,在里面进行跳转

注意:跳转方法尽量使用

SearchViewController *search1 = [self.storyboard instantiateViewControllerWithIdentifier:@"123"];

    [self.navigationController pushViewController:search1 animated:YES];

根据stroyboardID获取对象并且push,不可直接用textfield拖线进行跳转,不然会造成storyboard里的这个视图控制器设置无效

原文地址:https://www.cnblogs.com/OC888/p/5482706.html