Git Product home page Git Product logo

isemojiview's Introduction

ISEmojiView logo Version License Platform Carthage Compatible SPM supported

English | 中文

An easy to use Emoji keyboard for iOS.

Has been rewritten with swift, the old Objective-C version on branch oc.

Features

  • Written in Swift
  • Custom emojis
  • Multiple skin tone support ( 🏻 🏼 🏽 🏾 🏿 )
  • Categories bottom bar (like iOS system emoji Keyboard)
  • Recently used emoji
  • Dark Mode (#58)
  • SwiftUI support.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 5
  • iOS8+
  • Xcode 10

Useage

Installation

Swift Package Manager

via Swift Package Manager Install to your project,Add in Package.swift:

.package(name: "ISEmojiView", url: "https://github.com/isaced/ISEmojiView.git", .upToNextMinor(from: "0.3.0")),

In Xcode:

Cocoapods

# Swift
pod 'ISEmojiView'

# Objective-C (Deprecated)
pod 'ISEmojiView', '0.0.1'

Carthage

github "isaced/ISEmojiView"

Import

import ISEmojiView

Initialization

let keyboardSettings = KeyboardSettings(bottomType: .categories)
let emojiView = EmojiView(keyboardSettings: keyboardSettings)
emojiView.translatesAutoresizingMaskIntoConstraints = false
emojiView.delegate = self
textView.inputView = emojiView

Delegate

Implement <EmojiViewDelegate>

// callback when tap a emoji on keyboard
func emojiViewDidSelectEmoji(_ emoji: String, emojiView: EmojiView) {
    textView.insertText(emoji)
}

// callback when tap change keyboard button on keyboard
func emojiViewDidPressChangeKeyboardButton(_ emojiView: EmojiView) {
    textView.inputView = nil
    textView.keyboardType = .default
    textView.reloadInputViews()
}
    
// callback when tap delete button on keyboard
func emojiViewDidPressDeleteBackwardButton(_ emojiView: EmojiView) {
    textView.deleteBackward()
}

// callback when tap dismiss button on keyboard
func emojiViewDidPressDismissKeyboardButton(_ emojiView: EmojiView) {
    textView.resignFirstResponder()
}

Customize

KeyboardSettings

This is a class to desribe keyboard settings. Available properties:

  • bottomType - type of bottom view. Available variants: .pageControl, .categories. See BottomType enum. Default .pageControl.
  • customEmojis - array of custom emojis. To describe emojis you have to use EmojiCategory class.
  • isShowPopPreview - long press to pop preview effect like iOS10 system emoji keyboard. Default is true.
  • countOfRecentsEmojis - the max number of recent emojis, if set 0, nothing will be shown. Default is 50.
  • needToShowAbcButton - need to show change keyboard button. This button is located in Categories bottom view.

SwiftUI

Doesn't work on macOS SwiftUI natively.

import ISEmojiView

EmojiView_SwiftUI()
    .frame(width: 300, height: 500)
    .padding()

countOfRecentsEmojis, needToShowAbcButton, needToShowDeleteButton, updateRecentEmojiImmediately can be passed to EmojiView_SwiftUI as parameters.

Others

If you are looking for a React Native solution, take a look at this brendan-rius/react-native-emoji-keyboard

License

MIT

isemojiview's People

Contributors

beniamiiin avatar develolongscript avatar imgbotapp avatar isaced avatar justinmann avatar karunstha avatar levivig avatar lhr000lhrmega avatar moriquendi avatar r0uter avatar richy486 avatar tladesignz avatar vzsg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

isemojiview's Issues

First Emoji selection not working

i have an issue when the pop up appears
when I select the emoji for the first time it doesn't respond
thats only for the first time , for the second time i select the emoji and didSelectEmoji method is called normally
after reviewing the code and unlock it , i commented these lines in EmojiCollectionView.swift didSelectItemAt method line 164

//        guard emojiPopView.isHidden else {
//            dismissPopView(false)
//            return
//        }

And the issue solved
could you please solve this issue from your side
thanks in advance :)

Not dismiss ISEmojiView

i use this ISEmojiView keyboard it's working fine but how to dismiss and please add toolbar.
tnx.

iOS 12.1 New Emojis?

Would you be willing to adding the new emojis from iOS 12.1? Would very much appreciate it!
image

New selected emoji will always appear as first in recent.

#41 Since system emoji keyboard's recent sorted by tap frequency, I have changed ISEmojiView's recent emoji rule that always put new used emoji on first.

This behavior prevented the freqently used emoji disappear from the recent section. 🙂

iOS 12 UIResponder.keyboardWillChangeFrameNotification,No response

In the iOS 12,registered UIResponder.keyboardWillChangeFrameNotification,click ABC Button,To switch the keyboard,notification no response,I use the following code:

lazy var emojiView: EmojiView = {
let keyboardSettings = KeyboardSettings(bottomType: .categories)
keyboardSettings.countOfRecentsEmojis = 10
keyboardSettings.needToShowAbcButton = true

    let emojiView = EmojiView(keyboardSettings: keyboardSettings)
    emojiView.translatesAutoresizingMaskIntoConstraints = false
    return emojiView

}()

func showEmojiKeyboard() {
emojiView.delegate = self
emojiTextView.inputView = emojiView
emojiTextView.becomeFirstResponder()
}

extension viewController: EmojiViewDelegate {

func emojiViewDidSelectEmoji(_ emoji: String, emojiView: EmojiView) {
    emojiTextView.insertText(emoji)
}

func emojiViewDidPressDeleteBackwardButton(_ emojiView: EmojiView) {
    emojiTextView.deleteBackward()
}

func emojiViewDidPressChangeKeyboardButton(_ emojiView: EmojiView) {
    emojiTextView.inputView = nil
    emojiTextView.keyboardType = .default
    emojiTextView.reloadInputViews()
}

func emojiViewDidPressDismissKeyboardButton(_ emojiView: EmojiView) {
    emojiTextView.resignFirstResponder()
}

}

Longpress states as iOS

There are different skin tones for the same emoji's on longpress. Currently on longpress only 1 is visible , any possible updates on that ?

Multiple emoji category issue

Hi

I'm use multiple custom category in your lib. When i'm add 25 up category, Bottom category icon not good UI show. If there you can scrolling bottom view good to view and user easily access all.

I like your lib and implemented in my app.

Thnx

Please allow update frame of EmojiView

I'm developing on iphoneX and realized that height of EmojiView not same as height keyboard. So, when switch between emoji and text, keyboard has been up down. Please fix!

Doesn't build in XCode 12 Swift 5.3

Anyone else getting this? ... the last line of the log is ** BUILD SUCCEEDED **

******* Error *********

carthage update --platform iOS

*** Building scheme "ISEmojiView" in ISEmojiView.xcodeproj
Build Failed
Task failed with exit code 1:
/usr/bin/xcrun lipo -create /var/root/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/ISEmojiView/0.2.6/Build/Intermediates.noindex/ArchiveIntermediates/ISEmojiView/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ISEmojiView.framework/ISEmojiView /var/root/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/ISEmojiView/0.2.6/Build/Products/Release-iphonesimulator/ISEmojiView.framework/ISEmojiView -output /Users/userreportingissuenow/Projects/practicePlayer/Carthage/Build/iOS/ISEmojiView.framework/ISEmojiView

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/carthage-xcodebuild.jNHiqP.log

Carthage issue

Hello,

I have some trouble with Carthage and ISEmojiView, got this error Module file's minimum deployment target is ios10.1 v10.1, any idea to fix it ? :)

Thank you

Delete button does not appear

Using version 0.3.3 (SPM).
The delete button is missing from the category view.

let keyboardSettings = KeyboardSettings(bottomType: .categories)
keyboardSettings.isShowPopPreview = true
keyboardSettings.needToShowAbcButton = false
keyboardSettings.needToShowDeleteButton = true
keyboardSettings.updateRecentEmojiImmediately = true

The delete button does not appear.
Using the pageControl bottom type and a delete button results in a crash.

How to open Emoji Keyboard on button?

Hello, First of all, great repository.
Currently, I am working on chat application and in which I am using emoji keyboard but I have to open emoji keyboard on button click like WhatsApp rather than text view click.
how can I achieve that?

Xcode 10 Beta 3

Hi.
I don't know if you've run this on Xcode 10 beta 3 but I am getting an error

'UIEdgeInsetsInsetRect' has been replaced by instance method 'CGRect.inset(by:)'

in the ISEmoji.swift file

🎃 Missing Pumpkin Emoji

With October right around the corner, would love to have the pumpkin emoji available for our users. Thanks again for the library, @isaced !

ISEmojiView
IMG_0085

iOS Default
IMG_0086

incorrect image path

Could not load the "ic_emojiDelete.png" image referenced from a nib in the bundle with identifier "org.cocoapods.ISEmojiView"

Emoji keyboard tap confirmation

When typing on the emoji keyboard, there is no visual confirmation that the emoji tapped was successfully selected.
Please refer attached gif image, I need to implement exactly like this

Emoji Keyboard Confirmation

New Emojis 13.2

Hi!
Will you update the library to add the new Emojis that Apple released on October 28?
Thanks!

Updated Emojis? Recent Emojis?

Hi! ISEmojiView has been great! Is there any way you could update the emojis? iOS came out with a lot of new emojis and it would be super if you could include those as well.

Also is there anyway to see the recent emojis in the first screen?

Few methodes and properties are not working

Nice example but following delegate not working and properties

  1. needToShowAbcButton

When set categories keyboard
// callback when tap delete button on keyboard
func emojiViewDidPressDeleteButton(emojiView: EmojiView) {
txtView.deleteBackward()
}

// callback when tap dismiss button on keyboard
func emojiViewDidPressDismissKeyboardButton(_ emojiView: EmojiView) {
    txtView.resignFirstResponder()
} type

And when set Page Controller Type that time following delegate not working

// callback when tap delete button on keyboard
func emojiViewDidPressDeleteButton(emojiView: EmojiView) {
txtView.deleteBackward()
}

iOS 10 issues

  1. on ios 10 the categories bar at bottom only have two sections.
  2. tap on history icon when there is no history causes a crash.

all these are caused by the titles of all the categories in ISEmojiList_iOS10.plist mismatch with the titles in the Category enum.

Support Dark Keyboard on iOS 13 when Dark Mode is enabled

Keyboard has white background on iOS 13 when in dark mode.

For reference, if this helps speed up implementation:

        if #available(iOS 13, *) {
            if (vc.traitCollection.userInterfaceStyle == .dark) {
                // Make keyboard background dark.
            }
        }

Blank category icons

Thanks for this fantastic library. I wanted to report that i am seeing blank category icons.

I am testing on Swift 5/Xcode 10.2 and iOS 12.

Thanks!

App freeze on init

When initializing emoji view
var emojiView = ISEmojiView()
App just freezes. CPU goes to 100%, memory consumption rises by around 25mb/second.
Happens both on iOS 10 & iOS 11

Am trying to show emojikeyboard with custom categories

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)

        }
}

Some emoji appear as block ? boxes

iOS: 11.0.1
ISEmojiView: 0.0.7

I'm guessing because my older version of iOS doesn't have the included Unicode glyphs supported? Maybe there should be a check?

img_00242

Skin Tone emojis don't work when selected from the "recently used" section

Steps to re-create:

  • Launch the emoji keyboard and select a skin tone emoji
  • Re-open the keyboard, the skin tone emoji should now be in the recently used section
  • Select the skin tone emoji from the recently used section

Expected results: The skin tone emoji to appear after being selected from recently used.

Actual results: The default yellow version of that emoji appears when the skin tone emoji has been selected.

Can someone explain this line to me? This ends up throwing a 'null pointer' exception.

section = emojis.index(where: { $0.category == Category.smileysAndPeople })!

When the category is 'recent' for this function, I am getting an exception because the above line returns nil.
It's probably because of the following:
Force-unwrap using '!' to abort execution if the optional value contains 'nil'

I am new to Swift and iOS development, so maybe I am just missing something.

Thanks,
Tenzin

Disable list of emoji

Hello !

Thank you for this library ! 👍
It is possible to not show somes emoji ? (because some emoji can't be read on Android..)

Thank you,
Florian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.