I'm getting unicode scalar for emojis in a text string that I get from a server, which fail to show up as emojis when I print them in a UILabel
. This is the format in which I get my string from server:
let string = "Hi, I'm lily U+1F609"
This doesn't work unless it's changed to
let string = "Hi, I'm lily \u{1F609}"
Is there anyway I can convert the string to the required format?
I don't want to use a regex to determine occurrences of U+<HEX_CODE>
and then converting them to \u{HEX_CODE}
. There has to be a better way of doing this.