How to list (almost) all emojis in Swift for iOS 8 without using any form of lookup tables?

后端 未结 1 388
闹比i
闹比i 2020-12-14 20:11

I\'m playing around with emojis in Swift using Xcode playground for some simple iOS8 apps. For this, I want to create something similar to a unicode/emoji map/description.

相关标签:
1条回答
  • 2020-12-14 21:02

    You can loop over those hex values with a Range: 0x1F601...0x1F64F and then create the Strings using a UnicodeScalar:

    for i in 0x1F601...0x1F64F {
        var c = String(UnicodeScalar(i))
        print(c)
    }
    

    Outputs:

    0 讨论(0)
提交回复
热议问题