Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neerajbaid/NBEmojiSearchView
A searchable emoji dropdown view.
https://github.com/neerajbaid/NBEmojiSearchView
Last synced: about 1 month ago
JSON representation
A searchable emoji dropdown view.
- Host: GitHub
- URL: https://github.com/neerajbaid/NBEmojiSearchView
- Owner: neerajbaid
- Created: 2015-06-14T18:03:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T01:33:53.000Z (over 9 years ago)
- Last Synced: 2024-12-01T03:41:47.190Z (about 1 month ago)
- Language: Objective-C
- Homepage:
- Size: 7.88 MB
- Stars: 84
- Watchers: 6
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ios-star - NBEmojiSearchView - A searchable emoji dropdown view. (Text / Other Testing)
- awesome-ios - NBEmojiSearchView - A searchable emoji dropdown view. (Text / Other Testing)
README
NBEmojiSearchView
====================
Integrate a searchable emoji dropdown into your iOS app in just a few lines.![](screencast.gif)
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](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like NBEmojiSearchView in your projects.```ruby
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.
```smalltalk
NBEmojiSearchView *emojiSearchView = [[NBEmojiSearchView alloc] init];
```
then
```smalltalk
[emojiSearchView installOnTextField:textField];
```
or
```smalltalk
[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.
```smalltalk
@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.
```smalltalk
@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**
```smalltalk
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.
```smalltalk
@property (nonatomic, strong) UIFont *font;
```The text color of the emoji result cells.
```smalltalk
@property (nonatomic, strong) UIColor *textColor;
```The header title of the `tableView` that displays emoji search results.
```smalltalk
@property (nonatomic, strong) NSString *headerTitle;
```###Delegate Methods
These delegate methods revolve around the appearance and disappearance of the search view. Please [let me know](http://twitter.com/2neeraj) or PR if you'd like additional delegate methods.
```smalltalk
- (void)emojiSearchViewWillAppear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewDidAppear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewWillDisappear:(NBEmojiSearchView *)emojiSearchView;
- (void)emojiSearchViewDidDisappear:(NBEmojiSearchView *)emojiSearchView;
```