Swiftpack.co - isaced/ISEmojiView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by isaced.
isaced/ISEmojiView 0.3.4
Emoji Keyboard for iOS
⭐️ 495
🕓 1 year ago
iOS
.package(url: "https://github.com/isaced/ISEmojiView.git", from: "0.3.4")

ISEmojiView logo Version License Platform Carthage Compatible SPM supported

English | 中文

An easy to use Emoji keyboard for iOS.

Has been rewritten with swift, tsrc="https://raw.github.com/isaced/ISEmojiView/master/d 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.

Others

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

License

MIT

GitHub

link
Stars: 495
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.3.4
1 year ago
  • Fix countOfRecentsEmojis not work #76
/// The max number of recent emojis, if set 0, nothing will be shown. Default is 50.
public var countOfRecentsEmojis: Int = MaxCountOfRecentsEmojis

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics