Skip to content

Commit 3a23172

Browse files
feat: implement getting data from json
1 parent 39ee6b8 commit 3a23172

31 files changed

Lines changed: 558 additions & 11348 deletions
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
uuid = "B2CDFE57-799F-4932-9721-8AE688FFD3FD"
4+
type = "0"
5+
version = "2.0">
6+
</Bucket>

Example App/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ EXTERNAL SOURCES:
1111
:path: "../"
1212

1313
SPEC CHECKSUMS:
14-
EmojiPicker: 6b9b72b2942cd9abe971efb76a1ec8a430a3f432
14+
EmojiPicker: a21d785c95a64a0284b0d1472150d90c4348d5e3
1515

1616
PODFILE CHECKSUM: e686a8fbd8a5367eac0bf7fb77e0bbddf18a2353
1717

Example App/Pods/Local Podspecs/EmojiPicker.podspec.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example App/Pods/Manifest.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example App/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 374 additions & 340 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/EmojiPicker/Extensions/Foundation/Bundle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension Bundle {
3232
- Note: It was named same as for Swift Package to simplify usage.
3333
*/
3434
static var module: Bundle {
35-
let path = Bundle(for: UnicodeManager.self).path(forResource: "Resources", ofType: "bundle") ?? ""
35+
let path = Bundle(for: EmojiManager.self).path(forResource: "Resources", ofType: "bundle") ?? ""
3636
return Bundle(path: path) ?? Bundle.main
3737
}
3838
}

Sources/EmojiPicker/Models/EmojiModel.swift renamed to Sources/EmojiPicker/Models/Category.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// The MIT License (MIT)
2-
// Copyright © 2022 Ivan Izyumkin
2+
// Copyright © 2022 Egor Badmaev
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -19,20 +19,19 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
// SOFTWARE.
2121

22+
struct Category: Decodable {
23+
let id: CategoryType
24+
let emojis: [String]
25+
}
26+
2227
/// Describes types of emoji categories.
23-
enum EmojiCategoryType: Int {
28+
enum CategoryType: String, Decodable, CaseIterable {
2429
case people
2530
case nature
26-
case foodAndDrink
31+
case foods
2732
case activity
28-
case travelAndPlaces
33+
case places
2934
case objects
3035
case symbols
3136
case flags
3237
}
33-
34-
/// Describes emoji categories.
35-
struct EmojiCategory {
36-
let categoryName: String
37-
let emojis: [[Int]]
38-
}

Sources/EmojiPicker/Models/Emoji.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,10 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
// SOFTWARE.
2121

22-
struct EmojiSet: Decodable {
23-
let categories: [Category]
24-
let emojis: [String: Emoji]
25-
let aliases: [String: String]
26-
let sheet: Sheet
27-
}
28-
29-
// MARK: - Category
30-
31-
struct Category: Decodable {
32-
let id: String
33-
let emojis: [String]
34-
}
35-
36-
// MARK: - Emoji
37-
3822
struct Emoji: Decodable {
3923
let id, name: String
4024
let keywords: [String]
4125
let skins: [Skin]
4226
let version: Double
4327
let emoticons: [String]?
4428
}
45-
46-
// MARK: - Skin
47-
48-
struct Skin: Decodable {
49-
let unified, native: String
50-
let x, y: Int
51-
}
52-
53-
// MARK: - Sheet
54-
55-
struct Sheet: Decodable {
56-
let cols, rows: Int
57-
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// The MIT License (MIT)
2+
// Copyright © 2022 Egor Badmaev
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in all
12+
// copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
// SOFTWARE.
21+
22+
struct EmojiSet: Decodable {
23+
let categories: [Category]
24+
let emojis: [String: Emoji]
25+
let aliases: [String: String]
26+
}

0 commit comments

Comments
 (0)