Skip to content

Am trying to show emojikeyboard with custom categories  #65

@Gouthamansriniv

Description

@Gouthamansriniv

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions