Created
December 20, 2016 16:54
-
-
Save oaleeapp/c0b02b96cc706283fce54e9170d25a24 to your computer and use it in GitHub Desktop.
Get random emoji
This file contains hidden or 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
extension String{ | |
static func randomEmoji()->String{ | |
let emojiStart = 0x1F601 | |
let ascii = emojiStart + Int(arc4random_uniform(UInt32(35))) | |
let emoji = UnicodeScalar(ascii)?.description | |
return emoji ?? "😍" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment