Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 2.77 KB

README.md

File metadata and controls

84 lines (56 loc) · 2.77 KB

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: [email protected].

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.