Reputation: 14844
In android all I have to do in the equivalent of "interface builder" is
android:maxLines="140";//twitter's character limit
Is there an equivalently simple method for iOS?
Upvotes: 0
Views: 699
Reputation: 593
Use the UITextFieldDelegate to listen the length of input, you can see this uitextfield-maximun
also you need adapt the protocol and set the delegate to your textfield.
Upvotes: 1
Reputation: 1341
int n = 140;
NSString *displaySTR = ......
if ([displaySTR length] > n) {
displaySTR = [string substringToIndex:n];
}
Upvotes: 0