Update README
This commit is contained in:
@@ -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({
|
||||
|
||||
3685
Sources/EmojiKitLibrary/Resources/emojis_v14.json
Normal file
3685
Sources/EmojiKitLibrary/Resources/emojis_v14.json
Normal file
File diff suppressed because it is too large
Load Diff
3716
Sources/EmojiKitLibrary/Resources/emojis_v15.json
Normal file
3716
Sources/EmojiKitLibrary/Resources/emojis_v15.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user