Skip to content

Commit

Permalink
Merge pull request #10 from htmlprogrammist/develop
Browse files Browse the repository at this point in the history
3.0.6
  • Loading branch information
htmlprogrammist authored Jan 26, 2023
2 parents b19895c + 3c1e4fe commit 1d2cc6b
Show file tree
Hide file tree
Showing 50 changed files with 941 additions and 11,539 deletions.
2 changes: 1 addition & 1 deletion EmojiPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|

s.source = { :git => 'https://github.com/htmlprogrammist/EmojiPicker.git', :tag => s.version.to_s }
s.source_files = 'Sources/EmojiPicker/**/*.{swift}'
s.resource_bundle = { "EmojiPicker" => ["Sources/EmojiPicker/**/*.lproj/*.{strings}"] }
s.resource_bundle = { "Resources" => ["Sources/EmojiPicker/**/*.{json,strings}"] }

s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'Tests/EmojiPickerTests/**/*.{swift}'
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "B2CDFE57-799F-4932-9721-8AE688FFD3FD"
type = "0"
version = "2.0">
</Bucket>
2 changes: 1 addition & 1 deletion Example App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
EmojiPicker: 4b34979fe8adbe0c59a210c3d1bff3223ca4cdfb
EmojiPicker: a21d785c95a64a0284b0d1472150d90c4348d5e3

PODFILE CHECKSUM: e686a8fbd8a5367eac0bf7fb77e0bbddf18a2353

Expand Down
4 changes: 2 additions & 2 deletions Example App/Pods/Local Podspecs/EmojiPicker.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example App/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

815 changes: 412 additions & 403 deletions Example App/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/EmojiPicker/Extensions/Foundation/Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension Bundle {
- Note: It was named same as for Swift Package to simplify usage.
*/
static var module: Bundle {
let path = Bundle(for: UnicodeManager.self).path(forResource: "EmojiPicker", ofType: "bundle") ?? ""
let path = Bundle(for: EmojiManager.self).path(forResource: "Resources", ofType: "bundle") ?? ""
return Bundle(path: path) ?? Bundle.main
}
}
Expand Down
45 changes: 45 additions & 0 deletions Sources/EmojiPicker/Models/Category.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// The MIT License (MIT)
// Copyright © 2022 Egor Badmaev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/// An object that represents category of emojis.
struct Category: Decodable {
/// Type-safe category type.
let type: CategoryType
/// Identifiers of emojis.
let emojis: [String]

enum CodingKeys: String, CodingKey {
case type = "id"
case emojis
}
}

/// Type-safe representation of emoji categories.
enum CategoryType: String, Decodable, CaseIterable {
case people
case nature
case foods
case activity
case places
case objects
case symbols
case flags
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The MIT License (MIT)
// Copyright © 2022 Ivan Izyumkin
// Copyright © 2022 Egor Badmaev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,20 +19,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/// Describes types of emoji categories.
enum EmojiCategoryType: Int {
case people
case nature
case foodAndDrink
case activity
case travelAndPlaces
case objects
case symbols
case flags
}

/// Describes emoji categories.
struct EmojiCategory {
let categoryName: String
let emojis: [[Int]]
/// An object that represents emoji.
struct Emoji: Decodable {
/// Emoji identifier.
let id: String
/// Name of an emoji.
let name: String
/// Keywords for an emoji.
let keywords: [String]
/// Skin tones.
let skins: [Skin]
/// Version in which the emoji appeared.
let version: Double
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The MIT License (MIT)
// Copyright © 2022 Ivan Izyumkin
// Copyright © 2022 Egor Badmaev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,20 +19,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import Foundation

/**
Emojis are being represented as hex values. This code converts provided emojis (ints) to a one line string.

- Experiment: `[0x1F600, 0x1F601, 0x1F602, 0x1F923, 0x1F603]` -> "😀😁😂🤣😃".
*/
extension Array where Element == Int {
func emoji() -> String {
var emoji = ""
for hexValue in self {
guard let unicode = UnicodeScalar(hexValue) else { break }
emoji.append(String(unicode))
}
return emoji
}
/// An object that represents set of emojis.
struct EmojiSet: Decodable {
/// Emoji categories.
let categories: [Category]
/// Emojis dictionary. Key is the name (id) of emoji.
let emojis: [String: Emoji]
/// Aliases of keywords for emojis.
let aliases: [String: String]
}
28 changes: 28 additions & 0 deletions Sources/EmojiPicker/Models/Skin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// The MIT License (MIT)
// Copyright © 2022 Egor Badmaev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/// An object that represents skin tones for emojis.
struct Skin: Decodable {
/// Unicode.
let unified: String
/// Emoji as symbol. For example: 😄
let native: String
}
1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/11.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/12.1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/13.1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/13.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/14.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sources/EmojiPicker/Resources/Data/5.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "SMILEYS & MENSCHEN";
"animalsAndNature" = "TIERE & NATUR";
"foodAndDrinks" = "ESSEN und TRINKEN";
"activities" = "AKTIVITÄT";
"travellingAndPlaces" = "REISEN & ORTE";
"people" = "SMILEYS & MENSCHEN";
"nature" = "TIERE & NATUR";
"foods" = "ESSEN und TRINKEN";
"activity" = "AKTIVITÄT";
"places" = "REISEN & ORTE";
"objects" = "OBJEKTE";
"symbols" = "SYMBOLE";
"flags" = "FLAGGEN";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "SMILEYS & PEOPLE";
"animalsAndNature" = "ANIMALS & NATURE";
"foodAndDrinks" = "FOOD & DRINK";
"activities" = "ACTIVITY";
"travellingAndPlaces" = "TRAVEL & PLACES";
"people" = "SMILEYS & PEOPLE";
"nature" = "ANIMALS & NATURE";
"foods" = "FOOD & DRINK";
"activity" = "ACTIVITY";
"places" = "TRAVEL & PLACES";
"objects" = "OBJECTS";
"symbols" = "SYMBOLS";
"flags" = "FLAGS";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "SMILEYS ET PERSONNES";
"animalsAndNature" = "ANIMAUX ET NATURE";
"foodAndDrinks" = "NOURRITURE ET BOISSONS";
"activities" = "ACTIVITÉ";
"travellingAndPlaces" = "VOYAGES ET LIEUX";
"people" = "SMILEYS ET PERSONNES";
"nature" = "ANIMAUX ET NATURE";
"foods" = "NOURRITURE ET BOISSONS";
"activity" = "ACTIVITÉ";
"places" = "VOYAGES ET LIEUX";
"objects" = "OBJETS";
"symbols" = "SYMBOLES";
"flags" = "DRAPEAUX";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "स्माइली और लोग";
"animalsAndNature" = "पशु और प्रकृति";
"foodAndDrinks" = "खाद्य और पेय";
"activities" = "गतिविधि";
"travellingAndPlaces" = "यात्रा और स्थान";
"people" = "स्माइली और लोग";
"nature" = "पशु और प्रकृति";
"foods" = "खाद्य और पेय";
"activity" = "गतिविधि";
"places" = "यात्रा और स्थान";
"objects" = "ऑब्जेक्ट्स";
"symbols" = "प्रतीक";
"flags" = "झंडे";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "СМАЙЛИКИ И ЛЮДИ";
"animalsAndNature" = "ЖИВОТНЫЕ И ПРИРОДА";
"foodAndDrinks" = "ЕДА И НАПИТКИ";
"activities" = "АКТИВНОСТЬ";
"travellingAndPlaces" = "ПУТЕШЕСТВИЯ И МЕСТНОСТИ";
"people" = "СМАЙЛИКИ И ЛЮДИ";
"nature" = "ЖИВОТНЫЕ И ПРИРОДА";
"foods" = "ЕДА И НАПИТКИ";
"activity" = "АКТИВНОСТЬ";
"places" = "ПУТЕШЕСТВИЯ И МЕСТНОСТИ";
"objects" = "ПРЕДМЕТЫ";
"symbols" = "СИМВОЛЫ";
"flags" = "ФЛАГИ";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "YÜZ İFADELERİ & İNSANLAR";
"animalsAndNature" = "HAYVANLAR & DOĞA";
"foodAndDrinks" = "YİYECEK & İÇECEK";
"activities" = "ETKİNLİK";
"travellingAndPlaces" = "SEYAHET & YERLER";
"people" = "YÜZ İFADELERİ & İNSANLAR";
"nature" = "HAYVANLAR & DOĞA";
"foods" = "YİYECEK & İÇECEK";
"activity" = "ETKİNLİK";
"places" = "SEYAHET & YERLER";
"objects" = "NESNELER";
"symbols" = "SEMBOLLER";
"flags" = "BAYRAKLAR";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"emotionsAndPeople" = "СМАЙЛИКИ Й ЛЮДИ";
"animalsAndNature" = "ФЛОРА І ФАУНА";
"foodAndDrinks" = "ЇЖА І НАПОЇ";
"activities" = "АКТИВНІСТЬ";
"travellingAndPlaces" = "ПОДОРОЖІ Й МІСЦЯ";
"people" = "СМАЙЛИКИ Й ЛЮДИ";
"nature" = "ФЛОРА І ФАУНА";
"foods" = "ЇЖА І НАПОЇ";
"activity" = "АКТИВНІСТЬ";
"places" = "ПОДОРОЖІ Й МІСЦЯ";
"objects" = "ОБ'ЄКТИ";
"symbols" = "СИМВОЛИ";
"flags" = "ПРАПОРИ";
Loading

0 comments on commit 1d2cc6b

Please sign in to comment.