A searchable emoji dropdown view.

Overview

NBEmojiSearchView

Integrate a searchable emoji dropdown into your iOS app in just a few lines.

To start searching, the user just types a :. Then, the emojiSearchView will automatically parse text to find the user's search query and display results appropriately. When the user selects an emoji, the emojiSearchView will automatically insert it into the correct location in the textField or textView.

##Installation ###CocoaPods CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like NBEmojiSearchView in your projects.

pod "NBEmojiSearchView"

###Alternative Alternatively, you can just drag the Source folder into your project.

##Usage Instantiate an NBEmojiSearchView, then install it on a UITextField or UITextView as shown below.

NBEmojiSearchView *emojiSearchView = [[NBEmojiSearchView alloc] init];

then

[emojiSearchView installOnTextField:textField];

or

[emojiSearchView installOnTextView:textView];

You control sizing and placement of the emojiSearchView. The emojiSearchView will appear and disappear at the appropriate times automatically.

###Customization

The UITableView that displays results is exposed.

@property (nonatomic, strong) UITableView *tableView;

Animation

The appearance and disappearance animations. Set these blocks with custom animations you'd like the emojiSearchView to execute.

If you choose to customize these the appear or disappear animation, you MUST call appearAnimationDidFinish or disappearAnimationDidFinish when the animation completes, respectively.

@property (nonatomic, copy) void (^appearAnimationBlock)(); "Default: A non-animated alpha change from 0.0 to 1.0."
@property (nonatomic, copy) void (^disappearAnimationBlock)(); "Default: A non-animated alpha change from 1.0 to 0.0."

Example

self.emojiSearchView.appearAnimationBlock = ^{
    [UIView animateWithDuration:0.2 animations:^{
        weakSelf.emojiSearchView.alpha = 1.0;
    } completion:^(BOOL finished) {
        [weakSelf.emojiSearchView appearAnimationDidFinish];
    }];
};

Other Visuals

The font of the emoji result cells.

@property (nonatomic, strong) UIFont *font;

The text color of the emoji result cells.

@property (nonatomic, strong) UIColor *textColor;

The header title of the tableView that displays emoji search results.

@property (nonatomic, strong) NSString *headerTitle;

###Delegate Methods

These delegate methods revolve around the appearance and disappearance of the search view. Please let me know or PR if you'd like additional delegate methods.

- (void)emojiSearchViewWillAppear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewDidAppear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewWillDisappear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewDidDisappear:(NBEmojiSearchView *)emojiSearchView;
You might also like...
Simple DropDown Alert View For Any iOS Projects.
Simple DropDown Alert View For Any iOS Projects.

⚠️ DEPRECATED, NO LONGER MAINTAINED JDropDownAlert JDropDownALert Simple DropDown Alert View For Any iOS Projects. Usage Top let alert = JDropDown

An emoji-liked rating view for iOS, implemented in Swift3.
An emoji-liked rating view for iOS, implemented in Swift3.

TTGEmojiRate An emoji-liked rating view for iOS, implemented in Swift3. Android version: PeterSmileRate by SilicorniO. Great work ! :) Inspired by Rat

TableViews - Emoji Table View For iOS With Swift
TableViews - Emoji Table View For iOS With Swift

TableViews Hello! This is EmojiTableView. Let me introduce you my first app when

Lightweight dropdown message bar in Swift. It's simple and beautiful.
Lightweight dropdown message bar in Swift. It's simple and beautiful.

SwiftyDrop SwiftyDrop is a lightweight pure Swift simple and beautiful dropdown message. Features Easy to use like: Drop.down("Message") Message field

✨ Awesome Dropdown menu for iOS with Swift 5.0
✨ Awesome Dropdown menu for iOS with Swift 5.0

The eligible dropdown menu for iOS, written in Swift 5, appears dropdown menu to display a view of related items when a user click on the dropdown menu. You can customize dropdown view whatever you like (e.g. UITableView, UICollectionView... etc)

Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.
Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.

ActionSheetPicker-3.0 Important update Now I fixed most of the things and merge PR' (thanks to ). I did much work to support this library from iOS 5.

The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.
The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.

Introduction The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when

A simple dropdown menu component for iPhone
A simple dropdown menu component for iPhone

AZDropdownMenu AZDropdownMenu is a simple dropdown menu component that supports Swift. Screenshots Code used in the screencast are included in the bun

🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs
🔻 Dropdown Menu for iOS with many customizable parameters to suit any needs

MKDropdownMenu Dropdown Menu for iOS with many customizable parameters to suit any needs. Inspired by UIPickerView. Installation CocoaPods MKDropdownM

JNDropDownMenu - Easy to use TableView style dropdown menu.
JNDropDownMenu - Easy to use TableView style dropdown menu.

Overview Swift version of https://github.com/dopcn/DOPDropDownMenu Easy to use TableView style dropdown menu. Setup The only thing you

Fantastic dropdown in Swift
Fantastic dropdown in Swift

Dropdowns ❤️ Support my app ❤️ Push Hero - pure Swift native macOS application to test push notifications Quick Access - Organise files in the Mac men

A lightweight dropdown notification for iOS 7+, in Swift.
A lightweight dropdown notification for iOS 7+, in Swift.

BRYXBanner A lightweight dropdown banner for iOS 7+. Usage Import BRYXBanner import BRYXBanner Create a banner using the designated initializer. let b

TextField with DropDown support using UIPickerView
TextField with DropDown support using UIPickerView

IQDropDownTextField TextField with DropDown support using UIPickerView Installing Install using cocoapods. Add in your Podfile: pod 'IQDropDownTextFie

This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit.
This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit.

CatalystToolbarMenuButton This is a simple Mac Catalyst example showcasing how to build a dropdown menu toolbar button using AppKit. There are ways to

An elegant dropdown for iOS written in Swift.
An elegant dropdown for iOS written in Swift.

UIDropDown An elegant dropdown for iOS written in Swift. Overview UIDropDown allows you to pick an option in a table just like dropdowns in web. It co

Simple and elegant Dropdown Transition
Simple and elegant Dropdown Transition

Simple and elegant dropdown transition for iOS Why? I needed to perform the dropdown transition in the app I was building and I've found many great li

Croc is a swift emoji string parsing library
Croc is a swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji characters, making emoji-powered features an easy task for developers.

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle
Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

A machine learning based emoji image classifier
A machine learning based emoji image classifier

BQBClassifier 🕶️ Download From App Store Given that my photo albums are mixed with various emojis that often spoil my good mood, I wrote such an app

Comments
  • NSInvalidArgumentException occurred!

    NSInvalidArgumentException occurred!

    I am using Swift so I don't know whether that is the problem.

    So I have a UITextField and an SZTextView (a subclass of UITextView). I wrote these two lines in viewDidLoad:

    NBEmojiSearchView().installOnTextView(txtContent)
    NBEmojiSearchView().installOnTextField(txtTitle)
    

    just like you did in README.md

    When viewDidLoad was called, I got this exception and the app crashes:

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x0081d494 __exceptionPreprocess + 180
        1   libobjc.A.dylib                     0x02bf5e02 objc_exception_throw + 50
        2   CoreFoundation                      0x0081d3bd +[NSException raise:format:] + 141
        3   Foundation                          0x013e4455 +[NSJSONSerialization JSONObjectWithData:options:error:] + 67
        4   NBEmojiSearchView                   0x002b2ed4 -[NBEmojiManager loadEmoji] + 356
        5   NBEmojiSearchView                   0x002b2c1d -[NBEmojiManager init] + 125
        6   NBEmojiSearchView                   0x002b4b30 -[NBEmojiSearchView manager] + 96
        7   NBEmojiSearchView                   0x002b582b -[NBEmojiSearchView tableView:numberOfRowsInSection:] + 91
        8   UIKit                               0x01aa12f5 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 3174
        9   UIKit                               0x01aa5e82 -[UITableViewRowData numberOfRows] + 98
        10  UIKit                               0x0183ed39 -[UITableView noteNumberOfRowsChanged] + 141
        11  UIKit                               0x0183e1f4 -[UITableView reloadData] + 2189
        12  NBEmojiSearchView                   0x002b509d -[NBEmojiSearchView setFont:] + 141
        13  NBEmojiSearchView                   0x002b456d -[NBEmojiSearchView init] + 221
        14  MyApp                         0x00074db1 _TTOFCSo17NBEmojiSearchViewcfT_S_ + 33
        15  MyApp                         0x00074996 _TFCSo17NBEmojiSearchViewCfT_S_ + 86
        16  MyApp                         0x0006f7ce _TFC11PocketDiary21DiaryEditorController11viewDidLoadfT_T_ + 2718
        17  MyApp                         0x0006f952 _TToFC11PocketDiary21DiaryEditorController11viewDidLoadfT_T_ + 34
        18  UIKit                               0x0189bb72 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 44
        19  UIKit                               0x018a0692 -[UIViewController loadViewIfRequired] + 1384
        20  UIKit                               0x018a0ab1 -[UIViewController view] + 35
        21  UIKit                               0x018fb935 -[UINavigationController preferredContentSize] + 212
        22  UIKit                               0x01871eec -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 67
        23  UIKit                               0x0186dafc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 105
        24  UIKit                               0x018b0e3b __40+[UIViewController _scheduleTransition:]_block_invoke + 18
        25  UIKit                               0x016dd7cb _runAfterCACommitDeferredBlocks + 337
        26  UIKit                               0x016f3a60 _cleanUpAfterCAFlushAndRunDeferredBlocks + 103
        27  UIKit                               0x01701ef6 _afterCACommitHandler + 102
        28  CoreFoundation                      0x0072f75e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
        29  CoreFoundation                      0x0072f6be __CFRunLoopDoObservers + 398
        30  CoreFoundation                      0x0072503c __CFRunLoopRun + 1340
        31  CoreFoundation                      0x00724846 CFRunLoopRunSpecific + 470
        32  CoreFoundation                      0x0072465b CFRunLoopRunInMode + 123
        33  GraphicsServices                    0x05de0664 GSEventRunModal + 192
        34  GraphicsServices                    0x05de04a1 GSEventRun + 104
        35  UIKit                               0x016cfeb9 UIApplicationMain + 160
        36  MyApp                         0x0006cb51 main + 145
        37  libdyld.dylib                       0x045a6a25 start + 1
        38  ???                                 0x00000001 0x0 + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    

    What causes this? Is it because I'm using Swift?

    opened by Sweeper777 0
Releases(1.0)
Owner
Neeraj Baid
Neeraj Baid
A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters

NSString+Emojize A category on NSString to turn codes from Emoji Cheat Sheet into Unicode emoji characters. Getting Started In order to use NSString+E

DIY.org 643 Sep 8, 2022
Effortless emoji-querying in Swift

EmojiKit EmojiKit is a simple emoji-querying framework in Swift. It is used in Paste, an Emoji Search app in the App Store. Installation If you’re usi

Dasmer Singh 93 Nov 12, 2022
Emoji in Swift

Smile ❤️ Support my apps ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcut manage

Khoa 478 Dec 30, 2022
A Swift framework for using custom emoji in strings.

Emojica – a Swift framework for using custom emoji in strings. What does it do? Emojica allows you to replace the standard emoji in your iOS apps with

Dan 101 Nov 7, 2022
A simple library that provides standard Unicode emoji support across all platforms

Twitter Emoji (Twemoji) A simple library that provides standard Unicode emoji support across all platforms. Twemoji v13.1 adheres to the Unicode 13.0

Twitter 15k Jan 8, 2023
Swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji

Joe Kalash 125 Sep 27, 2021
The world's largest independent emoji font.

The world's largest independent emoji font.

JoyPixels Inc. 337 Dec 24, 2022
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view

ZSSRichTextEditor The Editor ZSSRichTextEditor is a beautiful Rich Text WYSIWYG Editor for iOS. It includes all of the standard editor tools one would

Nic Hubbard 3.7k Dec 31, 2022
SherlockForms - An elegant SwiftUI Form builder to create a searchable Settings and DebugMenu screens for iOS

??️‍♂️ SherlockForms What one man can invent Settings UI, another can discover i

Yasuhiro Inami 98 Dec 27, 2022
SymbolPicker - A simple and searchable SFSymbol Picker for SwiftUI

SymbolPicker A simple and searchable SFSymbol Picker for SwiftUI Features Symbol

Yubo Qin 39 Dec 22, 2022