1.創(chuàng)建表情的View
//改變內(nèi)容
//? Created by 張君寶 on 15/11/18.//? Copyright ? 2015年 海睿星巢文化. All rights reserved.//#import#import "ADTInsertEmojiCellNode.h"
@interface InputContentInChatViewManager : NSObject
{
@private
NSMutableArray *arrEmoji;
NSMutableString *strInputContent;
int m_length;
}
@property (nonatomic,strong)NSDictionary *Global_TopicEmoji;
+(InputContentInChatViewManager *)sharedInstance;
//設(shè)置當(dāng)前文本字符串
-(void)setCurrentWordContent:(NSString *)inputString;
//清空輸入內(nèi)容
-(void)clearInputConten;
-(void)insertEmojiNode:(ADTInsertEmojiCellNode *)insertNode;
//根據(jù)當(dāng)次的刪除range尋找數(shù)組是否有符合此range的數(shù)組,有則刪除
-(void)deleteEmojisWith:(NSRange)deleteRange;
-(int)lengthOfEmoji;
-(int)lengthOfWordChar;
@end
朋鞍。m文件
#import@interface ADTInsertEmojiCellNode : NSObject
@property (nonatomic,assign)NSInteger m_insertIndex;//當(dāng)前操作在整個字符串的位置,默認(rèn)從0開始
@property (nonatomic,assign)NSInteger m_selectedEmojiIndex;//當(dāng)前操作的表情字符串?dāng)?shù)組中得位置,默認(rèn)從零開始
@property (nonatomic,assign)BOOL m_isDeleted;//被搜索到的刪除就置為yes
@property (nonatomic,copy)NSString *m_oriEmo;
@property (nonatomic,copy)NSString *m_tranEmo;
@end
#import "ADTInsertEmojiCellNode.h"
@implementation ADTInsertEmojiCellNode
-(id)init
{
if (self=[super init]) {
self.m_selectedEmojiIndex=0;
self.m_insertIndex=0;
self.m_isDeleted=0;
}
return self;
}
@end
plist 文件
這里就創(chuàng)建完了,發(fā)表于顯示在label 上可以參考
https://github.com/zekunyan/UITextViewDIYEmojiExample