https://github.com/isaced/ISEmojiView
  
  
    Emoji Keyboard for iOS 
    https://github.com/isaced/ISEmojiView
  
emoji emoji-keyboard swift
        Last synced: 3 months ago 
        JSON representation
    
Emoji Keyboard for iOS
- Host: GitHub
 - URL: https://github.com/isaced/ISEmojiView
 - Owner: isaced
 - License: mit
 - Created: 2014-12-25T06:42:40.000Z (almost 11 years ago)
 - Default Branch: master
 - Last Pushed: 2024-08-20T07:33:36.000Z (about 1 year ago)
 - Last Synced: 2024-12-06T14:03:28.687Z (11 months ago)
 - Topics: emoji, emoji-keyboard, swift
 - Language: Swift
 - Size: 1 MB
 - Stars: 523
 - Watchers: 14
 - Forks: 119
 - Open Issues: 15
 - 
            Metadata Files:
            
- Readme: README.md
 - Changelog: CHANGELOG.md
 - Funding: .github/FUNDING.yml
 - License: LICENSE
 
 
Awesome Lists containing this project
- awesome-ios - ISEmojiView - Emoji Keyboard for iOS (UI / Keyboard)
 - awesome-swift - ISEmojiView - Emoji Keyboard for iOS (Libs / Keyboard)
 - awesome-ios-star - ISEmojiView - Emoji Keyboard for iOS (UI / Keyboard)
 - fucking-awesome-swift - ISEmojiView - Emoji Keyboard for iOS (Libs / Keyboard)
 
README
          
[](http://cocoapods.org/pods/ISEmojiView)
[](http://cocoapods.org/pods/ISEmojiView)
[](http://cocoapods.org/pods/ISEmojiView)
[](https://github.com/Carthage/Carthage)
[](https://swift.org/package-manager/)
English | [中文](/README_zh.md)
An easy to use Emoji keyboard for iOS.
Has been rewritten with swift, the old *Objective-C* version on branch [oc](https://github.com/isaced/ISEmojiView/tree/oc).
 
## Features
- [x] Written in Swift
- [x] Custom emojis
- [x] Multiple skin tone support (  🏻 🏼 🏽 🏾 🏿 )
- [x] Categories bottom bar (like iOS system emoji Keyboard)
- [x] Recently used emoji
- [x] Dark Mode ([#58](https://github.com/isaced/ISEmojiView/issues/58))
- [x] 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
## Usage
### Installation
#### Swift Package Manager
via [Swift Package Manager](https://swift.org/package-manager/) Install to your project,Add in Package.swift:
```swift
.package(name: "ISEmojiView", url: "https://github.com/isaced/ISEmojiView.git", .upToNextMinor(from: "0.3.0")),
```
In Xcode:
- File > Swift Packages > Add Package Dependency
- Add https://github.com/isaced/ISEmojiView.git
- Select "Up to Next Major" with "0.3.0"
#### Cocoapods
```Ruby
# Swift
pod 'ISEmojiView'
# Objective-C (Deprecated)
pod 'ISEmojiView', '0.0.1'
```
#### Carthage
```Ruby
github "isaced/ISEmojiView"
```
### Import
```Swift
import ISEmojiView
```
### Initialization
```Swift
let keyboardSettings = KeyboardSettings(bottomType: .categories)
let emojiView = EmojiView(keyboardSettings: keyboardSettings)
emojiView.translatesAutoresizingMaskIntoConstraints = false
emojiView.delegate = self
textView.inputView = emojiView
```
### Delegate
Implement ``
```Swift
// 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 describe 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.
```Swift
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](https://github.com/brendan-rius/react-native-emoji-keyboard)
## License
MIT