我有推送通知,在主体'\ u270c'中有什么是表情符号。但是当我收到通知时,它会显示此代码'\ u270c,而不是表情符号。怎么解决这个?
答案 0 :(得分:0)
这对你有用吗?
let unicodeReceived = "\\u270c"
if let integer = Int(unicodeReceived.replacingOccurrences(of: "\\u", with: ""), radix: 16),
let scalar = UnicodeScalar(integer) {
let value = String(scalar)
print(value)
}