54 lines
1.5 KiB
Markdown
54 lines
1.5 KiB
Markdown
ISEmojiView [](http://cocoadocs.org/docsets/ISEmojiView) [](http://cocoadocs.org/docsets/ISEmojiView) [](http://opensource.org/licenses/MIT)
|
|
===========
|
|
|
|
|
|
|
|
An easy to use Emoji keyboard for iOS.
|
|
|
|

|
|
|
|
## Install
|
|
|
|
### CocoaPods
|
|
|
|
```
|
|
pod 'ISEmojiView'
|
|
```
|
|
|
|
## Useage
|
|
|
|
### Init
|
|
```
|
|
// init ISEmojiView
|
|
ISEmojiView *emojiView = [[ISEmojiView alloc] initWithTextField:textView delegate:self];
|
|
textView.inputView = emojiView;
|
|
```
|
|
|
|
### Response
|
|
|
|
add protocol `ISEmojiViewDelegate` and implementation `emojiView:didSelectEmoji:` method
|
|
|
|
```
|
|
-(void)emojiView:(ISEmojiView *)emojiView didSelectEmoji:(NSString *)emoji{
|
|
self.textView.text = [self.textView.text stringByAppendingString:emoji];
|
|
}
|
|
```
|
|
and `emojiView:didPressDeleteButton:` method:
|
|
|
|
```
|
|
-(void)emojiView:(ISEmojiView *)emojiView didPressDeleteButton:(UIButton *)deletebutton{
|
|
if (self.textView.text.length > 0) {
|
|
NSRange lastRange = [self.textView.text rangeOfComposedCharacterSequenceAtIndex:self.textView.text.length-1];
|
|
self.textView.text = [self.textView.text substringToIndex:lastRange.location];
|
|
}
|
|
}
|
|
```
|
|
|
|
### Other
|
|
|
|
- `popAnimationEnable` to enable animation when tap a emoji
|
|
|
|
## License
|
|
|
|
MIT
|