Created
May 20, 2018 13:19
-
-
Save malcommac/59e5bd555139f82809c3f1832fc41836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let emailPattern = "([A-Za-z0-9_\\-\\.\\+])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]+)" | |
let style = StyleRegEx(pattern: emailPattern) { | |
$0.color = UIColor.red | |
$0.backColor = UIColor.yellow | |
} | |
let str = "My email is hello@danielemargutti.com and my website is http://www.danielemargutti.com".(style: style!) | |
self.label?.attributedText = str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment