Skip to content

htmlprogrammist/EmojiPicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

102 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EmojiPicker

Emoji picker for iOS like on macOS

Navigation

Installation

Ready for use with Swift 4.2+ on iOS 11.1+

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Itโ€™s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/htmlprogrammist/EmojiPicker", .upToNextMajor(from: "3.0.0"))
]

CocoaPods

The CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate EmojiPicker into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'EmojiPicker', :git => 'https://github.com/htmlprogrammist/EmojiPicker'

Manually

If you prefer not to use any of dependency managers, you can integrate manually. Put Sources/EmojiPicker folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Quick Start

Create UIButton and add selector as action:

@objc private func openEmojiPickerModule(sender: UIButton) {
    let viewController = EmojiPickerViewController()
    viewController.delegate = self
    viewController.sourceView = sender
    present(viewController, animated: true)
}

And then recieve emoji in the delegate method:

extension ViewController: EmojiPickerDelegate {
    func didGetEmoji(emoji: String) {
        emojiButton.setTitle(emoji, for: .normal)
    }
}

Usage

Delegate

Delegate for EmojiPicker to provide chosen emoji.

viewController.delegate = self

Source View

A view containing the anchor rectangle for the popover. You can create any UIView instances and set them as the sender.

viewController.sourceView = sender

Also, there is way more settings for configuration:

Selected emoji category tint color

Color for the selected emoji category. The default value of this property is .systemBlue.

viewController.selectedEmojiCategoryTintColor = .systemRed

Arrow direction

The direction of the arrow for EmojiPicker. The default value of this property is .up.

viewController.arrowDirection = .up

Horizontal inset

Inset from the sourceView border. The default value of this property is 0.

viewController.horizontalInset = 0

Is dismiss after choosing

Defines whether to dismiss emoji picker or not after choosing. The default value of this property is true.

viewController.isDismissedAfterChoosing = true

Custom height

Custom height for EmojiPicker. The default value of this property is nil.

viewController.customHeight = 300

Feedback generator style

Feedback generator style. To turn off, set nil to this parameter. The default value of this property is .light.

viewController.feedbackGeneratorStyle = .soft

Localization

  • English ๐Ÿ‡ฌ๐Ÿ‡ง
  • Russian ๐Ÿ‡ท๐Ÿ‡บ
  • Ukraine ๐Ÿ‡บ๐Ÿ‡ฆ
  • French ๐Ÿ‡ซ๐Ÿ‡ท
  • German ๐Ÿ‡ฉ๐Ÿ‡ช
  • Hindi ๐Ÿ‡ฎ๐Ÿ‡ณ
  • Turkish ๐Ÿ‡น๐Ÿ‡ท

Experiments

You can also try to play around with the project, see how it works or redo it for yourself and immediately see the result by opening the EmojiPicker.xcworkspace file from Example/ directory:

  1. Open EmojiPicker.xcworkspace file
  2. Expand Pods target
  3. Expand Development Pods and EmojiPicker directory
  4. Have fun!

About

A macOS-style popover to select emojis in your iOS apps

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 5