Add support vor v15.1 (#2)
This commit is contained in:
committed by
GitHub
parent
977c01327f
commit
4688e9b0f7
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# EmojiKit
|
# 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
|
## Installation
|
||||||
The repository includes to different products with different use cases:
|
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.
|
> 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
|
### 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
|
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.
|
1. Clone the repository and `cd` into it.
|
||||||
2. Run `swift run -c release EmojiSourceKit` to build the package.
|
2. Run `swift run -c release EmojiSourceKit` to build the package.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public enum EmojiManager {
|
|||||||
case v13_1 = 13.1
|
case v13_1 = 13.1
|
||||||
case v14 = 14
|
case v14 = 14
|
||||||
case v15 = 15
|
case v15 = 15
|
||||||
|
case v15_1 = 15.1
|
||||||
|
|
||||||
public var fileName: String {
|
public var fileName: String {
|
||||||
return "emojis_v\(versionIdentifier)"
|
return "emojis_v\(versionIdentifier)"
|
||||||
@@ -26,6 +27,8 @@ public enum EmojiManager {
|
|||||||
return "14.0"
|
return "14.0"
|
||||||
case .v15:
|
case .v15:
|
||||||
return "15.0"
|
return "15.0"
|
||||||
|
case .v15_1:
|
||||||
|
return "15.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3834
Sources/EmojiKit/Resources/emojis_v15.1.json
Normal file
3834
Sources/EmojiKit/Resources/emojis_v15.1.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@ import Foundation
|
|||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
import EmojiKit
|
import EmojiKit
|
||||||
|
|
||||||
|
#if os(macOS)
|
||||||
struct EmojiDownloader: ParsableCommand, AsyncParsableCommand {
|
struct EmojiDownloader: ParsableCommand, AsyncParsableCommand {
|
||||||
|
|
||||||
static let configuration: CommandConfiguration = CommandConfiguration(
|
static let configuration: CommandConfiguration = CommandConfiguration(
|
||||||
@@ -121,5 +122,5 @@ struct EmojiDownloader: ParsableCommand, AsyncParsableCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
extension EmojiManager.Version: ExpressibleByArgument {}
|
extension EmojiManager.Version: ExpressibleByArgument {}
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ import ArgumentParser
|
|||||||
@main
|
@main
|
||||||
struct EmojiScripts: ParsableCommand, AsyncParsableCommand {
|
struct EmojiScripts: ParsableCommand, AsyncParsableCommand {
|
||||||
|
|
||||||
|
#if os(macOS)
|
||||||
static let configuration: CommandConfiguration = CommandConfiguration(
|
static let configuration: CommandConfiguration = CommandConfiguration(
|
||||||
commandName: "emojis",
|
commandName: "emojis",
|
||||||
abstract: "Manage Emojis from Unicode",
|
abstract: "Manage Emojis from Unicode",
|
||||||
subcommands: [
|
subcommands: [
|
||||||
EmojiDownloader.self,
|
EmojiDownloader.self
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class UnicodeParser {
|
|||||||
/// Split line into list of entries
|
/// Split line into list of entries
|
||||||
let lineComponents = line.split(separator: ";")
|
let lineComponents = line.split(separator: ";")
|
||||||
|
|
||||||
/// Get hex-string from compenents
|
/// Get hex-string from components
|
||||||
guard let hexString = lineComponents.map({ $0.trim() }).first else {
|
guard let hexString = lineComponents.map({ $0.trim() }).first else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user