开发者

Email Validation based on domain

开发者 https://www.devze.com 2023-03-04 13:20 出处:网络
I want to know in COCOA, how can we validate email based on domain. For example, if i need that e开发者_如何学Gomail address entered on text field should be from apple.com (ex: abc@apple.com) only, me

I want to know in COCOA, how can we validate email based on domain. For example, if i need that e开发者_如何学Gomail address entered on text field should be from apple.com (ex: abc@apple.com) only, means if anyone enter gmail.com (ex : abc@gmail.com), so it should be invalid email address.

Thanks.


NSString *email;
if (! [[email lowercaseString] hasSuffix:@"apple.com"]) {
    // show error
}


Try a text entry field with a label next to it saying @apple.com

0

精彩评论

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