MCEmojiPicker
About
It is a customizable library implementing macOS style emoji picker popover.
If you are interested in how I developed it and what difficulties I encountered in the process, you can read an article on Medium, Habr about it.
And if you like the project, don't forget to put star β
.
Limitations
- Does not support two part emojis. For example:
- Supported: π€π» π€πΏ
- Not supported: π«±πΏβπ«²π» π«±πΌβπ«²πΏ
If you know how to fix it - welcome to the discussion.
Apps Using
If you use a MCEmojiPicker, add your application via Pull Request. Fore more information you can see contribution guide.
Navigation
Requirements
- Swift
4.2&5.0 - Ready for use on iOS 11.1+
- SwiftUI is supported from iOS 13.0
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate MCEmojiPicker into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'MCEmojiPicker'Swift Package Manager
The Swift Package Manager is a tool for managing the distribution of Swift code. Itβs integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
To integrate MCEmojiPicker into your Xcode project using Xcode 11, specify it in Project > Swift Packages:
https://github.com/izyumkin/MCEmojiPicker
Manually
If you prefer not to use any of the aforementioned dependency managers, you can integrate MCEmojiPicker into your project manually. Put Source/MCEmojiPicker 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 selectEmojiAction(_ sender: UIButton) {
let viewController = MCEmojiPickerViewController()
viewController.delegate = self
viewController.sourceView = sender
present(viewController, animated: true)
}And then recieve emoji in the delegate method:
extension ViewController: MCEmojiPickerDelegate {
func didGetEmoji(emoji: String) {
emojiButton.setTitle(emoji, for: .normal)
}
}Usage
Selected emoji category tint color
Color for the selected emoji category. The default value of this property is .systemBlue.
viewController.selectedEmojiCategoryTintColor = .systemRedArrow direction
The direction of the arrow for EmojiPicker. The default value of this property is .up.
viewController.arrowDirection = .upHorizontal inset
Inset from the sourceView border. The default value of this property is 0.
viewController.horizontalInset = 0Is dismiss after choosing
Defines whether to dismiss emoji picker or not after choosing. The default value of this property is true.
viewController.isDismissAfterChoosing = trueCustom height
Custom height for EmojiPicker. The default value of this property is nil.
viewController.customHeight = 300Feedback generator style
Feedback generator style. To turn off, set nil to this parameter. The default value of this property is .light.
viewController.feedBackGeneratorStyle = .softSwiftUI
Use like system popover. All settings are available in the method initializer.
Button(selectedEmoji) {
isPresented.toggle()
}.emojiPicker(
isPresented: $isPresented,
selectedEmoji: $selectedEmoji
)or interact directly with the SwiftUI wrapper for the MCEmojiPickerViewController:
MCEmojiPickerRepresentableController(
isPresented: $isPresented,
selectedEmoji: $selectedEmoji,
arrowDirection: .up,
customHeight: 380.0,
horizontalInset: .zero,
isDismissAfterChoosing: true,
selectedEmojiCategoryTintColor: .systemBlue,
feedBackGeneratorStyle: .light
)Localization
π This library supports all existing localizations
TODO
- The main functionality for choosing emojis
- Dark mode
- Segmented control for jumping an emoji section
- Automatic adjustment of the relevant set of emoji for the iOS version
- Select skin tones from popup
- Frequently used
- Search bar and search results

