Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Am trying to show emojikeyboard with custom categories #65

Open
Gouthamansriniv opened this issue Nov 19, 2020 · 0 comments
Open

Am trying to show emojikeyboard with custom categories #65

Gouthamansriniv opened this issue Nov 19, 2020 · 0 comments

Comments

@Gouthamansriniv
Copy link

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)

        }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant