Create a UITextField
suggest changeInitialize the UITextField
with a CGRect as a frame:
Swift
let textfield = UITextField(frame: CGRect(x: 0, y: 0, width: 200, height: 21))
Objective-C
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 200, 21)];
You can also create a UITextField
in Interface Builder:
![](/essential/ios/img/8d2c2ea0bfbab01a892c990602c449b120730046.png)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents