Switch from Smile to EmojiKit
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Smile
|
||||
import EmojiKit
|
||||
|
||||
public final class DefaultEmojiProvider: EmojiProvider {
|
||||
|
||||
public init() { }
|
||||
|
||||
public func getAll() -> [Emoji] {
|
||||
return emojiList.values.map { Emoji(value: $0, name: name(emoji: $0).first ?? "") }
|
||||
return EmojiManager.getAvailableEmojis().flatMap { $0.emojis.values }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// Emoji.swift
|
||||
//
|
||||
//
|
||||
// Created by Kévin Sibué on 11/01/2023.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Emoji: Hashable {
|
||||
|
||||
public let value: String
|
||||
public let name: String
|
||||
|
||||
public init(value: String, name: String) {
|
||||
self.value = value
|
||||
self.name = name
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import EmojiKit
|
||||
|
||||
public struct EmojiPickerView: View {
|
||||
|
||||
@@ -39,7 +40,7 @@ public struct EmojiPickerView: View {
|
||||
return emojis
|
||||
} else {
|
||||
return emojis
|
||||
.filter { $0.name.lowercased().contains(search.lowercased()) }
|
||||
// .filter { $0.name.lowercased().contains(search.lowercased()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +73,6 @@ public struct EmojiPickerView: View {
|
||||
|
||||
struct EmojiPickerView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
EmojiPickerView(selectedEmoji: .constant(Emoji(value: "", name: "")))
|
||||
EmojiPickerView(selectedEmoji: .constant(Emoji(value: "", keywords: [])))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import EmojiKit
|
||||
|
||||
public protocol EmojiProvider {
|
||||
func getAll() -> [Emoji]
|
||||
|
||||
Reference in New Issue
Block a user