chquanquan / EmojiKeyboard

Emoji keyboard for iOS. contain emoji and GIF, preview function. manager emoji such as: add image or GIF from album. delete, drag to reorder. Support plainText convert Emoji attributeText, emoji attributeText convert plainText.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EmojiKeyboard

Emoji keyboard, custom emoji, gif, preview.

Language: Swift 4 Platform GitHub license

EmojiKeyboard is a keyboard for iOS IM. contain emoji and GIF, preview function. manager emoji such as: add image or GIF from album. delete, drag to reorder. Support plainText convert Emoji attributeText, emoji attributeText convert plainText.

sometimes you want to customer your style, add net sync function, change emoji sources. if you need some help, just send me Email: quan78886@qq.com.

ScreenShots

screenshots

demo GIF

screenshots GIF

Usage

  • clone this repo.
  • Simply drag and drop the 'EmojiKeyboard/EmojiKeyboard' folder into your project.
  • change emoji demo resources, delete GIF demo resource

simple code

create keyboard

   var emojiKeyboard: EmojiKeyboardView = {
       let keyboard = EmojiKeyboardView()
        keyboard.delegate = self
        return keyboard
    }()
    
    // set inputView
    textView.inputView = emojiKeyboard

Implementation protocol

extension ViewController: EmojiKeyboardViewDelegate {
    
    // click emoji
    func KeyboardView(_ KeyboardView: EmojiKeyboardView, use emoji: EmojiViewModel) {
        if emoji.type == .default {
            EmojiHelper.insertEmoji(for: textView, defaultEmojiImageName: emoji.defaultEmojiImageName!, desc: emoji.desc!)
        } else {
            EmojiHelper.getEmojiImage(for: imageView, with: emoji)
        }
    }
    
    // backward
    func emojiKeyBoardViewDidPressBackSpace(_ keyboardView: EmojiKeyboardView) {
        textView.deleteBackward()
    }
    
    // send action
    func sendContent(_ keyboardView: EmojiKeyboardView) {
        sendEmojiText()
    }
    
}

advice

you need add info Description

  • Privacy - Photo Library Additions Usage Description
  • Privacy - Photo Library Usage Description

request authorization before access album. (emojiKeyboard already do.)

first use EmojiKeyboard it will take some time load image Resouces from bundle, so I think you should preload the default emoji sources to menory. just like demo do.

License

EmojiKeyboard is available under the MIT license. See the LICENSE file for more info.

About

Emoji keyboard for iOS. contain emoji and GIF, preview function. manager emoji such as: add image or GIF from album. delete, drag to reorder. Support plainText convert Emoji attributeText, emoji attributeText convert plainText.

License:MIT License


Languages

Language:Swift 99.7%Language:Ruby 0.3%