A category on NSString for checking if a string is an email address.
CocoaPods is the recommended way to add NSString-Email
to your project.
- Add a pod entry for NSString-Email to your Podfile
pod 'NSString-Email', '~> 0.0.2'
- Install the pod(s) by running
pod install
.
Alternatively you can directly add source files to your project.
- Download the latest code version or add the repository as a git submodule to your git-tracked project.
- Open your project in Xcode, then drag and drop all files at
NSString-Email
folder onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
NSString *string = @"[email protected]";
BOOL isEmail = [string isEmail];
This code is distributed under the terms and conditions of the MIT license.
A brief summary of each NSString-Email release can be found on the wiki.