Update README

This commit is contained in:
Niklas Amslgruber
2023-06-14 18:45:44 +02:00
parent 22a0182e01
commit 6bbb3a1a71
5 changed files with 7482 additions and 25 deletions

View File

@@ -30,9 +30,11 @@ public enum EmojiManager {
/// - Parameters:
/// - version: The specific version you want to fetch (default: the highest supported version for a device's iOS version)
/// - showAllVariations: Some emojis inlcude skin type variations which increases the number of emojis drastically. (default: only the yellow neutral emojis are returned)
/// - url: Specify the location of the `emoji_v<version_number>.json` files if needed (default: bundle resource path)
/// - Returns: Array of categories with all emojis that are assigned to each category
public static func getAvailableEmojis(version: Version = .getSupportedVersion(), showAllVariations: Bool = false) -> [EmojiCategory] {
if let url = Bundle.main.url(forResource: version.fileName, withExtension: "json"), let content = try? Data(contentsOf: url), let result = try? JSONDecoder().decode([EmojiCategory].self, from: content) {
public static func getAvailableEmojis(version: Version = .getSupportedVersion(), showAllVariations: Bool = false, at url: URL? = nil) -> [EmojiCategory] {
let fileUrl = url ?? Bundle.module.url(forResource: version.fileName, withExtension: "json")
if let url = fileUrl, let content = try? Data(contentsOf: url), let result = try? JSONDecoder().decode([EmojiCategory].self, from: content) {
var filteredEmojis: [EmojiCategory] = []
for category in result {
let supportedEmojis = category.values.filter({

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff