Emoji keyboard, custom emoji, gif, preview.
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]
.
- clone this repo.
- Simply drag and drop the 'EmojiKeyboard/EmojiKeyboard' folder into your project.
- change emoji demo resources, delete GIF demo resource
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()
}
}
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.
EmojiKeyboard
is available under the MIT
license. See the LICENSE
file for more info.