Add support vor v15.1 (#2)

This commit is contained in:
Niklas Amslgruber
2024-01-13 10:26:40 +01:00
committed by GitHub
parent 977c01327f
commit 4688e9b0f7
6 changed files with 3850 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
# EmojiKit
A lightweight Swift package that gives you access to all available emojis for each iOS version. Additionally, this repository includes a script to fetch all emojis for a specific release from [Unicode.org](unicode.org).
A lightweight Swift package that gives you access to all available emojis for each iOS version. Additionally, this repository includes a script to fetch all emojis for a specific release from Unicode.org.
## Installation
The repository includes to different products with different use cases:
@@ -42,7 +42,10 @@ let emojisByCategory: [EmojiCategory] = EmojiManager.getAvailableEmojis()
> In most cases this part is not necessary if you just want to get the emojis in Swift. If you want to do some manual fetching or your app supports iOS versions below `iOS 15.0`, this chapter is for you.
The main idea behind this script is that there is no full list of supported emojis that can be easily used in Swift. This script fetches the full list of emojis from [Unicode.org](unicode.org), parses them and returns a structured `emojis_vX.json` file where all emojis are assigned to their official unicode category. The `.json` files can be easily parsed afterwards for further usage in any product.
The main idea behind this script is that there is no full list of supported emojis that can be easily used in Swift. This script fetches the full list of emojis from Unicode.org, parses them and returns a structured `emojis_vX.json` file where all emojis are assigned to their official unicode category. The `.json` files can be easily parsed afterwards for further usage in any product.
> **Note**
> Unicode released version 15.1 already, however these Emojis are not yet supported on iOS. `EmojiSourceKit` already contains the new Emojis, but they can't be used on iOS yet. We will release a new version once Apple integrated them.
### Installation
@@ -52,7 +55,7 @@ The main idea behind this script is that there is no full list of supported emoj
git clone https://github.com/niklasamslgruber/EmojiKit
```
To use `EomjiSourceKit` as a script from your Terminal, some further steps are required:
To use `EmojiSourceKit` as a script from your Terminal, some further steps are required:
1. Clone the repository and `cd` into it.
2. Run `swift run -c release EmojiSourceKit` to build the package.

View File

@@ -13,7 +13,8 @@ public enum EmojiManager {
case v13_1 = 13.1
case v14 = 14
case v15 = 15
case v15_1 = 15.1
public var fileName: String {
return "emojis_v\(versionIdentifier)"
}
@@ -26,6 +27,8 @@ public enum EmojiManager {
return "14.0"
case .v15:
return "15.0"
case .v15_1:
return "15.1"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@ import Foundation
import ArgumentParser
import EmojiKit
#if os(macOS)
struct EmojiDownloader: ParsableCommand, AsyncParsableCommand {
static let configuration: CommandConfiguration = CommandConfiguration(
@@ -121,5 +122,5 @@ struct EmojiDownloader: ParsableCommand, AsyncParsableCommand {
}
}
}
#endif
extension EmojiManager.Version: ExpressibleByArgument {}

View File

@@ -11,11 +11,13 @@ import ArgumentParser
@main
struct EmojiScripts: ParsableCommand, AsyncParsableCommand {
#if os(macOS)
static let configuration: CommandConfiguration = CommandConfiguration(
commandName: "emojis",
abstract: "Manage Emojis from Unicode",
subcommands: [
EmojiDownloader.self,
EmojiDownloader.self
]
)
#endif
}

View File

@@ -44,7 +44,7 @@ class UnicodeParser {
/// Split line into list of entries
let lineComponents = line.split(separator: ";")
/// Get hex-string from compenents
/// Get hex-string from components
guard let hexString = lineComponents.map({ $0.trim() }).first else {
continue
}