-
-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
Am trying to show emojikeyboard with custom categories this way below by calling func on tap of a button, but below code always opens usual keyboard with all default emojis with categories, any help will be much appreciated
func showEmojiKeyBoard() {
emojiKeyboard?.delegate = self
let keyboardSettings = KeyboardSettings(bottomType: .categories)
emojiKeyboard = EmojiView(keyboardSettings: keyboardSettings)
if let settingsURL = Bundle.main.path(forResource: "EmojisInCategories", ofType: "plist") {
do {
var emojiArray: EmojisInCategory?
let data = try Data(contentsOf: URL(fileURLWithPath: settingsURL))
let decoder = PropertyListDecoder()
emojiArray = try decoder.decode(EmojisInCategory.self, from: data)
keyboardSettings.customEmojis = [
EmojiCategory(
category: Category.custom("My Title", "customCategory"),
emojis: [Emoji(emojis: (emojiArray?.Activity)!), Emoji(emojis: ["🤣"])]
)
]
} catch {
print(error)
}
}
keyboardSettings.countOfRecentsEmojis = 20
keyboardSettings.updateRecentEmojiImmediately = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.03) {
self.view.addSubview((self.emojiKeyboard!));
self.emojiKeyboard?.addConstaintsToBottomofSuperview(leftOffset: 0, rightOffset: 0, bottomOffset: 0)
}
}
Metadata
Metadata
Assignees
Labels
No labels