Created
June 27, 2017 21:10
-
-
Save gavi/a85aa5d441362a97bc094fd72311c1c0 to your computer and use it in GitHub Desktop.
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 range = [UInt32](0x1F601...0x1F64F) | |
let ascii = range[Int(drand48() * (Double(range.count)))] | |
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