开发者

How to make a UITextField not respond?

I want to make a UITextField so开发者_如何转开发 that when I touch it, it runs a certain method, then if the conditions are correct (which are tested within that method), it will run its normal 'bring up the keyboard' method. How can I do this?


Set a delegate for your UITextField

textField.delegate = self;

Then within the delegate, implement:

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    if (condition) {
        return YES;
    }
    else {
        return NO;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜