Emoji picker for iOS like on macOS
Ready for use with Swift 4.2+ on iOS 11.1+
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"))
]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'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.
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)
}
}Delegate for EmojiPicker to provide chosen emoji.
viewController.delegate = selfA view containing the anchor rectangle for the popover. You can create any UIView instances and set them as the sender.
viewController.sourceView = senderAlso, there is way more settings for configuration:
Color for the selected emoji category. The default value of this property is .systemBlue.
viewController.selectedEmojiCategoryTintColor = .systemRedThe direction of the arrow for EmojiPicker. The default value of this property is .up.
viewController.arrowDirection = .upInset from the sourceView border. The default value of this property is 0.
viewController.horizontalInset = 0Defines whether to dismiss emoji picker or not after choosing. The default value of this property is true.
viewController.isDismissedAfterChoosing = trueCustom height for EmojiPicker. The default value of this property is nil.
viewController.customHeight = 300Feedback generator style. To turn off, set nil to this parameter. The default value of this property is .light.
viewController.feedbackGeneratorStyle = .soft- English ๐ฌ๐ง
- Russian ๐ท๐บ
- Ukraine ๐บ๐ฆ
- French ๐ซ๐ท
- German ๐ฉ๐ช
- Hindi ๐ฎ๐ณ
- Turkish ๐น๐ท
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:
- Open
EmojiPicker.xcworkspacefile - Expand
Podstarget - Expand
Development PodsandEmojiPickerdirectory - Have fun!

