├── LZBKeyBoardView.zip ├── LZBKeyBoardView ├── LZBKeyBoardView │ ├── LZBKeyBoardView │ │ ├── Resource.bundle │ │ │ ├── compose_emotion_delete@2x.png │ │ │ ├── iocn_comment_expression@2x.png │ │ │ ├── iocn_comment_expression@3x.png │ │ │ ├── iocn_comment_keyboard@2x.png │ │ │ ├── iocn_comment_keyboard@3x.png │ │ │ ├── btn_comment_expression_send@2x.png │ │ │ ├── btn_comment_expression_send@3x.png │ │ │ ├── compose_emotion_delete_highlighted@2x.png │ │ │ └── emoji.plist │ │ ├── FaceView │ │ │ ├── LZBEmojiModel.m │ │ │ ├── LZBEmojiButton.h │ │ │ ├── LZBFaceView.h │ │ │ ├── LZBEmojiModel.h │ │ │ ├── LZBFaceSignlePageView.h │ │ │ ├── LZBEmojiButton.m │ │ │ ├── LZBFaceSignlePageView.m │ │ │ └── LZBFaceView.m │ │ ├── UIView+LZBViewFrame.h │ │ ├── NSString+LZBTranscoding.h │ │ ├── UIViewController+LZBKeyBoardObserver.h │ │ ├── LZBKeyBoardToolEmojiBar.h │ │ ├── LZBKeyBoardToolBar.h │ │ ├── LZBTextView.h │ │ ├── UIView+LZBViewFrame.m │ │ ├── LZBTextView.m │ │ ├── NSString+LZBTranscoding.m │ │ ├── UIViewController+LZBKeyBoardObserver.m │ │ ├── LZBKeyBoardToolBar.m │ │ └── LZBKeyBoardToolEmojiBar.m │ ├── LZBKeyBoardToolVC.h │ ├── LZBUserTextViewVC.h │ ├── LZBAutoAdjustViewVC.h │ ├── LZBEmojiKeyBoardVC.h │ ├── ViewController.h │ ├── main.m │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── LZBUserTextViewVC.m │ ├── Info.plist │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── LZBKeyBoardToolVC.m │ ├── LZBEmojiKeyBoardVC.m │ ├── AppDelegate.m │ ├── ViewController.m │ └── LZBAutoAdjustViewVC.m └── LZBKeyBoardView.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── README.md ├── .gitignore └── LICENSE /LZBKeyBoardView.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView.zip -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/compose_emotion_delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/compose_emotion_delete@2x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_expression@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_expression@2x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_expression@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_expression@3x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_keyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_keyboard@2x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_keyboard@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/iocn_comment_keyboard@3x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/btn_comment_expression_send@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/btn_comment_expression_send@2x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/btn_comment_expression_send@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/btn_comment_expression_send@3x.png -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/compose_emotion_delete_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzbgithubcode/LZBKeyBoardView/HEAD/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/compose_emotion_delete_highlighted@2x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LZBKeyBoardView 2 | 自定义键盘(高仿微信) 3 | 4 | 详细解说请参考简书地址: 5 | #自定义键盘系列之一怎样自定义输入文本框 (http://www.jianshu.com/p/ec8fe1133afb) 6 | 7 | #自定义键盘系列之二键盘自适应响应者 (http://www.jianshu.com/p/595f94053527) 8 | 9 | #自定义键盘系列之三自定义无表情的键盘 (http://www.jianshu.com/p/e79f4dc330ba) 10 | 11 | #自定义键盘系列之四自定义带表情的键盘 (http://www.jianshu.com/p/96573649b89c) 12 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolVC.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/4. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBKeyBoardToolVC : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBUserTextViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBUserTextViewVC.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBUserTextViewVC : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBAutoAdjustViewVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBAutoAdjustViewVC.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/30. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBAutoAdjustViewVC : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBEmojiKeyBoardVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiKeyBoardVC.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBEmojiKeyBoardVC : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LZBKeyBoardView 4 | // 5 | // Created by zibin on 16/11/29. 6 | // Copyright © 2016年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBEmojiModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiModel.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBEmojiModel.h" 11 | 12 | @implementation LZBEmojiModel 13 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 14 | {}; 15 | @end 16 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBEmojiButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiButton.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "LZBEmojiModel.h" 12 | 13 | @interface LZBEmojiButton : UIButton 14 | 15 | @property (nonatomic, strong) LZBEmojiModel *model; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBFaceView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBFaceView.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "LZBEmojiModel.h" 12 | @interface LZBFaceView : UIView 13 | 14 | - (void)setEmojiModles:(NSArray *)emojiModles selectEmojiModelBlock:(void(^)(LZBEmojiModel*selectModel))selectBlock deleteBlcok:(void(^)())deleteBlcok sendBlcok:(void(^)())sendBlock; 15 | @end 16 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/UIView+LZBViewFrame.h: -------------------------------------------------------------------------------- 1 | 2 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 3 | 4 | #import 5 | 6 | @interface UIView (LZBViewFrame) 7 | 8 | //只能生成get/Set方法声明 9 | @property (nonatomic,assign) CGFloat LZB_width; 10 | 11 | @property (nonatomic,assign) CGFloat LZB_heigth; 12 | 13 | @property (nonatomic,assign) CGFloat LZB_x; 14 | 15 | @property (nonatomic,assign) CGFloat LZB_y; 16 | 17 | 18 | @property (nonatomic,assign) CGFloat LZB_centerX; 19 | 20 | @property (nonatomic,assign) CGFloat LZB_centerY; 21 | 22 | #pragma mark - API 23 | - (BOOL)isDisplayedInScreen; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBEmojiModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiModel.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBEmojiModel : NSObject 13 | 14 | /** 15 | * 表情的文字描述 16 | */ 17 | @property (nonatomic, strong) NSString *desc; 18 | 19 | /** 20 | * 表情的png图片名称 21 | */ 22 | @property (nonatomic, strong) NSString *png; 23 | 24 | /** 25 | * emoji表情的16进制编码 26 | */ 27 | @property (nonatomic, strong) NSString *code; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/NSString+LZBTranscoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+LZBTranscoding.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface NSString (LZBTranscoding) 13 | /** 14 | * 将十六进制的编码转为emoji字符 15 | */ 16 | + (NSString *)emojiWithByIntCode:(int)intCode; 17 | 18 | /** 19 | * 将十六进制字符串编码转为emoji字符 20 | */ 21 | + (NSString *)emojiWithByStringCode:(NSString *)stringCode; 22 | 23 | /** 24 | * 字符串对象转为emoji字符 25 | */ 26 | - (NSString *)emoji; 27 | 28 | /** 29 | * 字符串是否包含为emoji字符 30 | */ 31 | - (BOOL)isContainsEmoji; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/UIViewController+LZBKeyBoardObserver.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+LZBKeyBoardObserver.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/30. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | #pragma mark - 登录页面自动使用键盘高度 10 | 11 | #import 12 | //设置键盘和第一响应者的间距 13 | #define lzb_settingKeyBoard_DefaultMargin 10 14 | 15 | @interface UIViewController (LZBKeyBoardObserver) 16 | 17 | /** 18 | 增加点击任意地方消除键盘 19 | */ 20 | - (void)lzb_addKeyBoardTapAnyAutoDismissKeyBoard; 21 | 22 | /** 23 | 增加键盘监听观察者 24 | */ 25 | - (void)lzb_addKeyBoardObserverAutoAdjustHeight; 26 | 27 | /** 28 | 移除键盘监听观察者,必须实现 29 | */ 30 | - (void)lzb_removeKeyBoardObserver; 31 | @end 32 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolEmojiBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolEmojiBar.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface LZBKeyBoardToolEmojiBar : UIView 13 | /** 14 | 弹出自定义键盘和输入框工具条--有表情键盘 注意:一定是要在viewDidLayout中增加控件 15 | 16 | @param toolBarHeight 工具条的高度 17 | @param sendTextBlock 返回输入框输入的文字 18 | @return 返回LZBKeyBoardToolBar 19 | */ 20 | + (LZBKeyBoardToolEmojiBar *)showKeyBoardWithConfigToolBarHeight:(CGFloat)toolBarHeight sendTextCompletion:(void(^)(NSString *sendText))sendTextBlock; 21 | 22 | /** 23 | 设置输入框占位文字 24 | 25 | @param placeText 占位文字 26 | */ 27 | - (void)setInputViewPlaceHolderText:(NSString *)placeText; 28 | 29 | 30 | - (void)becomeFirstResponder; 31 | 32 | - (void)resignFirstResponder; 33 | @end 34 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolBar.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/4. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #pragma mark - 无表情键盘的工具条 11 | 12 | #import 13 | 14 | @interface LZBKeyBoardToolBar : UIView 15 | 16 | 17 | /** 18 | 弹出自定义键盘和输入框工具条--无表情键盘 注意:一定是要在viewDidLayout中增加控件 19 | 20 | @param toolBarHeight 工具条的高度 21 | @param sendTextBlock 返回输入框输入的文字 22 | @return 返回LZBKeyBoardToolBar 23 | */ 24 | + (LZBKeyBoardToolBar *)showKeyBoardWithConfigToolBarHeight:(CGFloat)toolBarHeight sendTextCompletion:(void(^)(NSString *sendText))sendTextBlock; 25 | 26 | 27 | 28 | /** 29 | 设置输入框占位文字 30 | @param placeText 占位文字 31 | */ 32 | - (void)setInputViewPlaceHolderText:(NSString *)placeText; 33 | 34 | 35 | - (void)becomeFirstResponder; 36 | 37 | - (void)resignFirstResponder; 38 | @end 39 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBTextView.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | #pragma mark - 自定义带有占位文字的UITextView 10 | 11 | #import 12 | 13 | @interface LZBTextView : UITextView 14 | 15 | /** 16 | * 设置占位文字 17 | */ 18 | @property (nonatomic, copy) NSString *placeholder; 19 | 20 | /** 21 | * 设置占位文字颜色 22 | */ 23 | @property (nonatomic, strong) UIColor *placeholderColor; 24 | 25 | /** 26 | * 占位文字的X偏移量 27 | */ 28 | @property (nonatomic, assign) CGFloat placeHolderOffsetX; 29 | 30 | /** 31 | * 占位文字的Y偏移量 32 | */ 33 | @property (nonatomic, assign) CGFloat placeHolderOffsetY; 34 | 35 | /** 36 | * 光标的偏移量 37 | */ 38 | @property (nonatomic, assign) UIOffset cursorOffset; 39 | 40 | /** 41 | * 是否隐藏 42 | */ 43 | @property (nonatomic, assign) BOOL placeHolderHidden; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBFaceSignlePageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LZBFaceSignlePageView.h 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import 11 | #import "LZBEmojiModel.h" 12 | //获取图片资源 13 | #define LZBKeyboardBundleImage(name) [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",@"Resource.bundle/",name]] 14 | //表情最大的行数 15 | #define LZBFaceSignlePageView_Emjoi_MaxRow 3 16 | //表情最大的列数 17 | #define LZBFaceSignlePageView_Emjoi_MaxCol 7 18 | //单页最多的表情个数 19 | #define LZBFaceSignlePageView_AllEmjoiCount ((LZBFaceSignlePageView_Emjoi_MaxRow * LZBFaceSignlePageView_Emjoi_MaxCol) - 1) 20 | 21 | 22 | @interface LZBFaceSignlePageView : UIView 23 | 24 | //data 25 | @property (nonatomic, strong) NSArray *emojiSignlePageModles; //表情赋值 26 | @property (nonatomic, copy) void (^emojiDidDeleteBlock)(); //表情删除回调 27 | @property (nonatomic, copy) void (^emojiDidSelectBlock)(LZBEmojiModel *emojiModel); //选中某个表情回调 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBEmojiButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiButton.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBEmojiButton.h" 11 | #import "NSString+LZBTranscoding.h" 12 | #define LZBKeyboardBundleImage(name) [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",@"Resource.bundle/",name]] 13 | @implementation LZBEmojiButton 14 | - (instancetype)initWithFrame:(CGRect)frame 15 | { 16 | if(self = [super initWithFrame:frame]) 17 | { 18 | [self setupUI]; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)setupUI 24 | { 25 | self.adjustsImageWhenHighlighted = NO; 26 | self.titleLabel.font = [UIFont systemFontOfSize:32]; 27 | } 28 | 29 | 30 | - (void)setModel:(LZBEmojiModel *)model 31 | { 32 | _model = model; 33 | if (model.png) { // 有图片 34 | [self setImage:LZBKeyboardBundleImage(model.png) forState:UIControlStateNormal]; 35 | } else if (model.code) { // 是emoji表情 36 | // 设置emoji 37 | [self setTitle:model.code.emoji forState:UIControlStateNormal]; 38 | } 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBUserTextViewVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBUserTextViewVC.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBUserTextViewVC.h" 11 | #import "LZBTextView.h" 12 | @interface LZBUserTextViewVC () 13 | @property (nonatomic, strong) LZBTextView *textView; 14 | @end 15 | 16 | @implementation LZBUserTextViewVC 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | //去除边沿延伸效果 22 | self.edgesForExtendedLayout = UIRectEdgeNone; 23 | [self.view addSubview:self.textView]; 24 | self.textView.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 200); 25 | self.textView.backgroundColor = [UIColor yellowColor]; 26 | self.textView.placeholder = @"请输入文字,颜色、间距、光标位置可调"; 27 | self.textView.placeholderColor = [UIColor redColor]; 28 | self.textView.font = [UIFont systemFontOfSize:18.0]; 29 | self.textView.cursorOffset = UIOffsetMake(5, 10); 30 | } 31 | 32 | - (LZBTextView *)textView 33 | { 34 | if(_textView == nil) 35 | { 36 | _textView = [LZBTextView new]; 37 | } 38 | return _textView; 39 | } 40 | @end 41 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolVC.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/4. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBKeyBoardToolVC.h" 11 | #import "LZBKeyBoardToolBar.h" 12 | 13 | 14 | @interface LZBKeyBoardToolVC () 15 | 16 | @property (nonatomic, strong) UILabel *textLabel; 17 | @property (nonatomic, strong) LZBKeyBoardToolBar *keyboardView ; 18 | @end 19 | 20 | @implementation LZBKeyBoardToolVC 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | self.view.backgroundColor = [UIColor grayColor]; 26 | self.automaticallyAdjustsScrollViewInsets = NO; 27 | [self.view addSubview:self.keyboardView]; 28 | [self.view addSubview:self.textLabel]; 29 | self.textLabel.frame = CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width, 300); 30 | 31 | } 32 | 33 | 34 | 35 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 36 | { 37 | [self.view endEditing:YES]; 38 | } 39 | 40 | 41 | #pragma mark - lazy 42 | - (LZBKeyBoardToolBar *)keyboardView 43 | { 44 | if(_keyboardView == nil) 45 | { 46 | __weak typeof(self) weakSelf = self; 47 | _keyboardView = [LZBKeyBoardToolBar showKeyBoardWithConfigToolBarHeight:0 sendTextCompletion:^(NSString *sendText) { 48 | weakSelf.textLabel.text = sendText; 49 | }]; 50 | [_keyboardView setInputViewPlaceHolderText:@"请设置占位文字"]; 51 | } 52 | return _keyboardView; 53 | } 54 | 55 | - (UILabel *)textLabel 56 | { 57 | if(_textLabel == nil) 58 | { 59 | _textLabel = [UILabel new]; 60 | _textLabel.textAlignment = NSTextAlignmentCenter; 61 | _textLabel.textColor = [UIColor redColor]; 62 | _textLabel.text = @"显示输入框输入文字"; 63 | _textLabel.numberOfLines = 0; 64 | } 65 | return _textLabel; 66 | } 67 | 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBEmojiKeyBoardVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBEmojiKeyBoardVC.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBEmojiKeyBoardVC.h" 11 | #import "LZBKeyBoardToolEmojiBar.h" 12 | 13 | @interface LZBEmojiKeyBoardVC () 14 | @property (nonatomic, strong) UILabel *textLabel; 15 | @property (nonatomic, strong) LZBKeyBoardToolEmojiBar *keyboardView ; 16 | @end 17 | 18 | @implementation LZBEmojiKeyBoardVC 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.view.backgroundColor = [UIColor yellowColor]; 23 | self.automaticallyAdjustsScrollViewInsets = NO; 24 | [self.view addSubview:self.keyboardView]; 25 | [self.view addSubview:self.textLabel]; 26 | self.textLabel.frame = CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width, 300); 27 | } 28 | 29 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 30 | { 31 | [self.view endEditing:YES]; 32 | } 33 | 34 | #pragma mark - lazy 35 | - (LZBKeyBoardToolEmojiBar *)keyboardView 36 | { 37 | if(_keyboardView == nil) 38 | { 39 | __weak typeof(self) weakSelf = self; 40 | _keyboardView = [LZBKeyBoardToolEmojiBar showKeyBoardWithConfigToolBarHeight:0 sendTextCompletion:^(NSString *sendText) { 41 | weakSelf.textLabel.text = sendText; 42 | }]; 43 | [_keyboardView setInputViewPlaceHolderText:@"请输入文字"]; 44 | } 45 | return _keyboardView; 46 | } 47 | 48 | - (UILabel *)textLabel 49 | { 50 | if(_textLabel == nil) 51 | { 52 | _textLabel = [UILabel new]; 53 | _textLabel.textAlignment = NSTextAlignmentCenter; 54 | _textLabel.textColor = [UIColor redColor]; 55 | _textLabel.text = @"显示输入框输入文字"; 56 | _textLabel.numberOfLines = 0; 57 | } 58 | return _textLabel; 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "AppDelegate.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | return YES; 22 | } 23 | 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 33 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 34 | } 35 | 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application { 38 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 39 | } 40 | 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application { 43 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 44 | } 45 | 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/UIView+LZBViewFrame.m: -------------------------------------------------------------------------------- 1 | 2 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 3 | #import "UIView+LZBViewFrame.h" 4 | 5 | @implementation UIView (LZBViewFrame) 6 | 7 | -(void)setLZB_x:(CGFloat)LZB_x 8 | { 9 | CGRect rect =self.frame; 10 | rect.origin.x =LZB_x; 11 | self.frame =rect; 12 | } 13 | 14 | -(void)setLZB_y:(CGFloat)LZB_y 15 | { 16 | CGRect rect =self.frame; 17 | rect.origin.y =LZB_y; 18 | self.frame =rect; 19 | } 20 | 21 | - (void)setLZB_width:(CGFloat)LZB_width 22 | { 23 | CGRect rect =self.frame; 24 | rect.size.width =LZB_width; 25 | self.frame =rect; 26 | } 27 | 28 | - (void)setLZB_heigth:(CGFloat)LZB_heigth 29 | { 30 | CGRect rect =self.frame; 31 | rect.size.height =LZB_heigth; 32 | self.frame =rect; 33 | } 34 | 35 | - (CGFloat)LZB_width 36 | { 37 | return self.frame.size.width; 38 | } 39 | 40 | - (CGFloat)LZB_heigth 41 | { 42 | return self.frame.size.height; 43 | } 44 | 45 | - (CGFloat)LZB_x 46 | { 47 | return self.frame.origin.x; 48 | } 49 | - (CGFloat)LZB_y 50 | { 51 | return self.frame.origin.y; 52 | } 53 | 54 | - (void)setLZB_centerX:(CGFloat)LZB_centerX 55 | { 56 | CGPoint center =self.center; 57 | center.x =LZB_centerX; 58 | self.center =center; 59 | } 60 | 61 | - (void)setLZB_centerY:(CGFloat)LZB_centerY 62 | { 63 | CGPoint center =self.center; 64 | center.y =LZB_centerY; 65 | self.center =center; 66 | } 67 | 68 | -(CGFloat)LZB_centerX 69 | { 70 | return self.center.x; 71 | } 72 | 73 | - (CGFloat)LZB_centerY 74 | { 75 | return self.center.y; 76 | } 77 | 78 | 79 | #pragma mark - API 80 | // 判断View是否显示在屏幕上 81 | - (BOOL)isDisplayedInScreen 82 | { 83 | if (self == nil) { 84 | return FALSE; 85 | } 86 | 87 | CGRect screenRect = [UIScreen mainScreen].bounds; 88 | 89 | // 转换view对应window的Rect 90 | CGRect rect = [self convertRect:self.frame fromView:nil]; 91 | if (CGRectIsEmpty(rect) || CGRectIsNull(rect)) { 92 | return FALSE; 93 | } 94 | 95 | // 若view 隐藏 96 | if (self.hidden) { 97 | return FALSE; 98 | } 99 | 100 | // 若没有superview 101 | if (self.superview == nil) { 102 | return FALSE; 103 | } 104 | 105 | // 若size为CGrectZero 106 | if (CGSizeEqualToSize(rect.size, CGSizeZero)) { 107 | return FALSE; 108 | } 109 | 110 | // 获取 该view与window 交叉的 Rect 111 | CGRect intersectionRect = CGRectIntersection(rect, screenRect); 112 | if (CGRectIsEmpty(intersectionRect) || CGRectIsNull(intersectionRect)) { 113 | return FALSE; 114 | } 115 | 116 | return TRUE; 117 | } 118 | @end 119 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "ViewController.h" 11 | #import "LZBTextView.h" 12 | #import "LZBAutoAdjustViewVC.h" 13 | #import "LZBKeyBoardToolVC.h" 14 | #import "LZBEmojiKeyBoardVC.h" 15 | 16 | 17 | @interface ViewController () 18 | @property (nonatomic, strong) LZBTextView *textView; 19 | @property (nonatomic, strong) UITableView *tableView; 20 | 21 | @property (nonatomic, strong) NSArray *methodKeys; 22 | @property (nonatomic, strong) NSArray *methodValues; 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | [self.view addSubview:self.tableView]; 30 | self.title= @"主页"; 31 | self.methodKeys = @[@"LZBUserTextViewVC", 32 | @"LZBAutoAdjustViewVC", 33 | @"LZBKeyBoardToolVC", 34 | @"LZBEmojiKeyBoardVC",]; 35 | //显示文字 36 | self.methodValues = @[@"LZBTextView的使用 - 输入多行文字", 37 | @"自定调整View来适应键盘-登录页面常用", 38 | @"无表情键盘工具条使用 - 发布评论常用", 39 | @"含有表情键盘工具条", 40 | ]; 41 | 42 | } 43 | 44 | 45 | #pragma mark- tableView 46 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 47 | { 48 | return self.methodKeys.count; 49 | } 50 | 51 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 52 | { 53 | static NSString *cellID = @"loadAnimaitonCell"; 54 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; 55 | if(cell == nil) 56 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; 57 | cell.textLabel.text = self.methodValues[indexPath.row]; 58 | return cell; 59 | } 60 | 61 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 62 | { 63 | NSString *method = self.methodKeys[indexPath.row]; 64 | Class classVC = NSClassFromString(method); 65 | UIViewController *vc = (UIViewController *)[classVC new]; 66 | [self.navigationController pushViewController:vc animated:YES]; 67 | 68 | } 69 | 70 | 71 | #pragma mark - 懒加载 72 | - (UITableView *)tableView 73 | { 74 | if(_tableView == nil) 75 | { 76 | _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) style:UITableViewStylePlain]; 77 | _tableView.dataSource = self; 78 | _tableView.delegate = self; 79 | } 80 | return _tableView; 81 | } 82 | 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBFaceSignlePageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBFaceSignlePageView.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | 11 | 12 | #import "LZBFaceSignlePageView.h" 13 | #import "LZBEmojiButton.h" 14 | 15 | #define LZBFaceSignlePageView_Default_LeftRightInset 15 //左右间距 16 | #define LZBFaceSignlePageView_Default_TopBottomInset 10 //上下间距 17 | 18 | @interface LZBFaceSignlePageView() 19 | 20 | @property (nonatomic, strong) UIButton *deleteButton; /** 删除按钮 */ 21 | 22 | @end 23 | 24 | @implementation LZBFaceSignlePageView 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | { 27 | if(self = [super initWithFrame:frame]) 28 | { 29 | [self addSubview:self.deleteButton]; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)setEmojiSignlePageModles:(NSArray *)emojiSignlePageModles 35 | { 36 | _emojiSignlePageModles = emojiSignlePageModles; 37 | NSInteger count = emojiSignlePageModles.count; 38 | for (NSInteger i = 0; i < count; i++) 39 | { 40 | LZBEmojiButton *emojiButton = [[LZBEmojiButton alloc]init]; 41 | [self addSubview:emojiButton]; 42 | emojiButton.model = emojiSignlePageModles[i]; 43 | [emojiButton addTarget:self action:@selector(emojiButtonClick:) forControlEvents:UIControlEventTouchUpInside]; 44 | } 45 | } 46 | 47 | - (void)layoutSubviews 48 | { 49 | [super layoutSubviews]; 50 | NSInteger count = self.emojiSignlePageModles.count; 51 | CGFloat emojiButtonW = (self.bounds.size.width - 2 *LZBFaceSignlePageView_Default_LeftRightInset)/LZBFaceSignlePageView_Emjoi_MaxCol; 52 | CGFloat emojiButtonH = (self.bounds.size.height - 2 *LZBFaceSignlePageView_Default_TopBottomInset)/LZBFaceSignlePageView_Emjoi_MaxRow; 53 | for (NSInteger i = 0; i < count; i++) 54 | { 55 | CGFloat emojiButtonX = LZBFaceSignlePageView_Default_LeftRightInset + (i%LZBFaceSignlePageView_Emjoi_MaxCol)*emojiButtonW; 56 | CGFloat emojiButtonY = LZBFaceSignlePageView_Default_TopBottomInset + (i/LZBFaceSignlePageView_Emjoi_MaxCol)*emojiButtonH; 57 | LZBEmojiButton *emojiButton = self.subviews[i + 1]; //第0个是删除按钮 58 | emojiButton.frame = CGRectMake(emojiButtonX, emojiButtonY, emojiButtonW, emojiButtonH); 59 | } 60 | LZBEmojiButton *lastEmojiButton = [self.subviews lastObject]; 61 | //布局删除按钮 62 | CGFloat deleteButtonX = lastEmojiButton.frame.origin.x + lastEmojiButton.bounds.size.width; 63 | CGFloat deleteButtonY = lastEmojiButton.frame.origin.y; 64 | CGFloat deleteButtonW = emojiButtonW; 65 | CGFloat deleteButtonH = emojiButtonH; 66 | self.deleteButton.frame = CGRectMake(deleteButtonX, deleteButtonY, deleteButtonW, deleteButtonH); 67 | 68 | 69 | } 70 | 71 | #pragma mark - handle 72 | - (void)deleteClick 73 | { 74 | if(self.emojiDidDeleteBlock) 75 | self.emojiDidDeleteBlock(); 76 | } 77 | 78 | - (void)emojiButtonClick:(LZBEmojiButton *)emojiButton 79 | { 80 | if(self.emojiDidSelectBlock) 81 | self.emojiDidSelectBlock(emojiButton.model); 82 | } 83 | 84 | #pragma mark - lazy 85 | - (UIButton *)deleteButton{ 86 | if (_deleteButton == nil) 87 | { 88 | _deleteButton = [UIButton buttonWithType:UIButtonTypeCustom]; 89 | [_deleteButton setImage:LZBKeyboardBundleImage(@"compose_emotion_delete")forState:UIControlStateNormal]; 90 | [_deleteButton addTarget:self action:@selector(deleteClick) forControlEvents:UIControlEventTouchUpInside]; 91 | } 92 | return _deleteButton; 93 | } 94 | @end 95 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBTextView.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/29. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBTextView.h" 11 | 12 | @interface LZBTextView() 13 | 14 | @property (nonatomic, strong) UILabel *placeholderLabel; 15 | 16 | @end 17 | 18 | @implementation LZBTextView 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame 21 | { 22 | if(self = [super initWithFrame:frame]) 23 | { 24 | [self addSubview:self.placeholderLabel]; 25 | self.alwaysBounceVertical = YES; 26 | self.font = [UIFont systemFontOfSize:14.0]; 27 | self.placeholderColor = [UIColor grayColor]; 28 | self.placeholderLabel.frame = CGRectMake(5, 10, 0, 0); 29 | // 监听文字改变 30 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange) name:UITextViewTextDidChangeNotification object:nil]; 31 | } 32 | return self; 33 | } 34 | 35 | 36 | #pragma mark - API 37 | - (void)setFont:(UIFont *)font 38 | { 39 | [super setFont:font]; 40 | self.placeholderLabel.font = font; 41 | [self computePlaceholderLabelSize]; 42 | } 43 | 44 | - (void)setPlaceholderColor:(UIColor *)placeholderColor 45 | { 46 | _placeholderColor = placeholderColor; 47 | self.placeholderLabel.textColor = placeholderColor; 48 | } 49 | 50 | - (void)setPlaceholder:(NSString *)placeholder 51 | { 52 | _placeholder = [placeholder copy]; 53 | self.placeholderLabel.text = placeholder; 54 | [self computePlaceholderLabelSize]; 55 | } 56 | 57 | - (void)setPlaceHolderOffsetX:(CGFloat)placeHolderOffsetX 58 | { 59 | _placeHolderOffsetX = placeHolderOffsetX; 60 | [self computePlaceholderLabelSize]; 61 | } 62 | 63 | - (void)setPlaceHolderOffsetY:(CGFloat)placeHolderOffsetY 64 | { 65 | _placeHolderOffsetY = placeHolderOffsetY; 66 | [self computePlaceholderLabelSize]; 67 | } 68 | 69 | - (void)setCursorOffset:(UIOffset)cursorOffset 70 | { 71 | _cursorOffset = cursorOffset; 72 | self.textContainerInset = UIEdgeInsetsMake(cursorOffset.vertical, cursorOffset.horizontal, cursorOffset.vertical,cursorOffset.horizontal); 73 | } 74 | 75 | - (void)setPlaceHolderHidden:(BOOL)placeHolderHidden 76 | { 77 | _placeHolderHidden = placeHolderHidden; 78 | self.placeholderLabel.hidden = placeHolderHidden; 79 | } 80 | 81 | #pragma mark - hanlde 82 | -(void)computePlaceholderLabelSize 83 | { 84 | CGFloat maxWidth = [UIScreen mainScreen].bounds.size.width - 2 * (self.placeholderLabel.frame.origin.x - self.placeHolderOffsetX); 85 | CGSize maxSize = CGSizeMake(maxWidth, MAXFLOAT); 86 | CGSize computeSize = [self.placeholder boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : self.font} context:nil].size; 87 | 88 | CGRect frame = self.placeholderLabel.frame; 89 | frame.size = computeSize; 90 | frame.origin.x = self.placeHolderOffsetX + frame.origin.x; 91 | frame.origin.y = self.placeHolderOffsetY + frame.origin.y; 92 | self.placeholderLabel.frame = frame; 93 | } 94 | 95 | - (void)textDidChange 96 | { 97 | self.placeHolderHidden = self.hasText; 98 | } 99 | 100 | #pragma mark - lazy 101 | - (UILabel *)placeholderLabel 102 | { 103 | if (!_placeholderLabel) { 104 | // 添加一个用来显示占位文字的label 105 | _placeholderLabel = [[UILabel alloc] init]; 106 | _placeholderLabel.numberOfLines = 0; 107 | } 108 | return _placeholderLabel; 109 | } 110 | - (void)dealloc 111 | { 112 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 113 | } 114 | @end 115 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBAutoAdjustViewVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBAutoAdjustViewVC.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/30. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBAutoAdjustViewVC.h" 11 | #import "LZBTextView.h" 12 | #import "UIViewController+LZBKeyBoardObserver.h" 13 | 14 | @interface LZBAutoAdjustViewVC () 15 | 16 | 17 | @property (nonatomic, strong) UIView *lastView; 18 | @end 19 | 20 | @implementation LZBAutoAdjustViewVC 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | self.view.backgroundColor = [UIColor whiteColor]; 25 | //去除边沿延伸效果 26 | self.edgesForExtendedLayout = UIRectEdgeNone; 27 | 28 | UILabel *titleLabel = [UILabel new]; 29 | titleLabel.textColor = [UIColor purpleColor]; 30 | titleLabel.text = @"注意:文本框自动适应键盘高度,主要用在登录页面"; 31 | titleLabel.numberOfLines = 0; 32 | titleLabel.frame = CGRectMake(0, 20, [UIScreen mainScreen].bounds.size.width, 50); 33 | titleLabel.textAlignment = NSTextAlignmentCenter; 34 | [self.view addSubview:titleLabel]; 35 | 36 | //第一个 37 | LZBTextView *textView1 = [[LZBTextView alloc]initWithFrame:CGRectMake(100, 100, 200, 40)]; 38 | [self.view addSubview:textView1]; 39 | textView1.backgroundColor = [UIColor yellowColor]; 40 | textView1.placeholder = @"第一个-LZBTextView"; 41 | textView1.placeholderColor = [UIColor redColor]; 42 | textView1.font = [UIFont systemFontOfSize:14.0]; 43 | self.lastView = textView1; 44 | 45 | //第二个 46 | LZBTextView *textView2 = [[LZBTextView alloc]initWithFrame:CGRectMake(100, CGRectGetMaxY(self.lastView.frame) + 50, 200, 40)]; 47 | self.lastView = textView2; 48 | [self.view addSubview:textView2]; 49 | textView2.backgroundColor = [UIColor yellowColor]; 50 | textView2.placeholder = @"第二个-LZBTextView"; 51 | textView2.placeholderColor = [UIColor blueColor]; 52 | textView2.font = [UIFont systemFontOfSize:16.0]; 53 | 54 | //第三个 55 | LZBTextView *textView3 = [[LZBTextView alloc]initWithFrame:CGRectMake(100, CGRectGetMaxY(self.lastView.frame) + 50, 200, 40)]; 56 | self.lastView = textView3; 57 | [self.view addSubview:textView3]; 58 | textView3.backgroundColor = [UIColor yellowColor]; 59 | textView3.placeholder = @"第三个-LZBTextView"; 60 | textView3.placeholderColor = [UIColor purpleColor]; 61 | textView3.font = [UIFont systemFontOfSize:16.0]; 62 | 63 | //第四个 64 | LZBTextView *textView4 = [[LZBTextView alloc]initWithFrame:CGRectMake(100, CGRectGetMaxY(self.lastView.frame) + 50, 200, 40)]; 65 | self.lastView = textView4; 66 | [self.view addSubview:textView4]; 67 | textView4.backgroundColor = [UIColor yellowColor]; 68 | textView4.placeholder = @"第四个-主要看键盘弹出"; 69 | textView4.placeholderColor = [UIColor darkGrayColor]; 70 | textView4.font = [UIFont systemFontOfSize:17.0]; 71 | 72 | 73 | //第四个 74 | LZBTextView *textView5 = [[LZBTextView alloc]initWithFrame:CGRectMake(100, CGRectGetMaxY(self.lastView.frame) + 50, 200, 40)]; 75 | self.lastView = textView5; 76 | [self.view addSubview:textView5]; 77 | textView5.backgroundColor = [UIColor yellowColor]; 78 | textView5.placeholder = @"第五个-主要看键盘弹出"; 79 | textView5.placeholderColor = [UIColor orangeColor]; 80 | textView5.font = [UIFont systemFontOfSize:17.0]; 81 | } 82 | 83 | - (void)viewWillAppear:(BOOL)animated 84 | { 85 | [super viewWillAppear:animated]; 86 | [self lzb_addKeyBoardTapAnyAutoDismissKeyBoard]; 87 | [self lzb_addKeyBoardObserverAutoAdjustHeight]; 88 | } 89 | 90 | 91 | - (void)dealloc 92 | { 93 | [self lzb_removeKeyBoardObserver]; 94 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 95 | } 96 | 97 | 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/NSString+LZBTranscoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+LZBTranscoding.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "NSString+LZBTranscoding.h" 11 | 12 | //#define EMOJI_CODE_TO_SYMBOL(x) (((0x808080F0 | (x & 0x3F000) >> 4) | (x & 0xFC0) << 10) | (x & 0x1C0000)) 13 | #define EMOJI_CODE_TO_SYMBOL(c) ((((0x808080F0 | (c & 0x3F000) >> 4) | (c & 0xFC0) << 10) | (c & 0x1C0000) << 18) | (c & 0x3F) << 24) 14 | @implementation NSString (LZBTranscoding) 15 | 16 | + (NSString *)emojiWithByIntCode:(int)intCode 17 | { 18 | int sym = EMOJI_CODE_TO_SYMBOL(intCode); 19 | NSString *codeString = [[NSString alloc]initWithBytes:&sym length:sizeof(sym) encoding:NSUTF8StringEncoding]; 20 | if (codeString == nil) { 21 | codeString = [NSString stringWithFormat:@"%C", (unichar)intCode]; 22 | } 23 | return codeString; 24 | } 25 | 26 | + (NSString *)emojiWithByStringCode:(NSString *)stringCode 27 | { 28 | char *charCode = (char *)stringCode.UTF8String; 29 | long intCode = strtol(charCode, NULL, 16); 30 | return [self emojiWithByIntCode:(int)intCode]; 31 | } 32 | 33 | /** 34 | * 转为emoji字符 35 | */ 36 | - (NSString *)emoji 37 | { 38 | return [NSString emojiWithByStringCode:self]; 39 | } 40 | 41 | - (BOOL)isContainsEmoji 42 | { 43 | __block BOOL returnValue = NO; 44 | if(self.length == 0) return returnValue; 45 | [self enumerateSubstringsInRange:NSMakeRange(0, [self length]) 46 | options:NSStringEnumerationByComposedCharacterSequences 47 | usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { 48 | const unichar hs = [substring characterAtIndex:0]; 49 | if (0xd800 <= hs && hs <= 0xdbff) 50 | { 51 | if (substring.length > 1) 52 | { 53 | const unichar ls = [substring characterAtIndex:1]; 54 | const int uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000; 55 | if (0x1d000 <= uc && uc <= 0x1f77f) 56 | { 57 | returnValue = YES; 58 | } 59 | } 60 | } 61 | else if (substring.length > 1) 62 | { 63 | const unichar ls = [substring characterAtIndex:1]; 64 | if (ls == 0x20e3) 65 | { 66 | returnValue = YES; 67 | } 68 | } 69 | else 70 | { 71 | if (0x2100 <= hs && hs <= 0x27ff) 72 | { 73 | returnValue = YES; 74 | } 75 | else if (0x2B05 <= hs && hs <= 0x2b07) 76 | { 77 | returnValue = YES; 78 | } 79 | else if (0x2934 <= hs && hs <= 0x2935) 80 | { 81 | returnValue = YES; 82 | } 83 | else if (0x3297 <= hs && hs <= 0x3299) 84 | { 85 | returnValue = YES; 86 | } 87 | else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b || hs == 0x2b50) 88 | { 89 | returnValue = YES; 90 | } 91 | } 92 | }]; 93 | 94 | return returnValue; 95 | } 96 | @end 97 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/FaceView/LZBFaceView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBFaceView.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/6. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBFaceView.h" 11 | #import "LZBFaceSignlePageView.h" 12 | #define LZBColorRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] 13 | 14 | 15 | @interface LZBFaceView() 16 | //View 17 | @property (nonatomic, strong) UIScrollView *scroollView; 18 | @property (nonatomic, strong) UIPageControl *pageControl; 19 | @property (nonatomic, strong) UIButton *sendButton; 20 | 21 | //data 22 | @property (nonatomic, strong) NSArray *emojiModles; //表情赋值 23 | @property (nonatomic, copy) void (^emojiDidDeleteBlock)(); //表情删除回调 24 | @property (nonatomic, copy) void (^emojiDidSendBlock)(); //表情发送回调 25 | @property (nonatomic, copy) void (^emojiDidSelectBlock)(LZBEmojiModel *emojiModel); //选中某个表情回调 26 | 27 | 28 | @end 29 | 30 | @implementation LZBFaceView 31 | 32 | - (instancetype)initWithFrame:(CGRect)frame 33 | { 34 | if(self = [super initWithFrame:frame]) 35 | { 36 | self.backgroundColor = [UIColor whiteColor]; 37 | [self addSubview:self.scroollView]; 38 | [self addSubview:self.pageControl]; 39 | [self addSubview:self.sendButton]; 40 | } 41 | return self; 42 | } 43 | 44 | - (void)layoutSubviews 45 | { 46 | [super layoutSubviews]; 47 | 48 | //发送按钮 49 | CGSize sendButtonSize= self.sendButton.currentImage.size; 50 | self.sendButton.frame = CGRectMake(self.bounds.size.width - sendButtonSize.width, self.bounds.size.height - sendButtonSize.height, sendButtonSize.width, sendButtonSize.height); 51 | 52 | //pageControl 53 | self.pageControl.bounds = CGRectMake(0, 0, self.bounds.size.width, 15); 54 | self.pageControl.center = CGPointMake(self.center.x, self.sendButton.center.y); 55 | 56 | //scrollView 57 | self.scroollView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - self.sendButton.bounds.size.height); 58 | 59 | //单个面板控件 60 | NSInteger count = self.scroollView.subviews.count; 61 | for (NSInteger i = 0; i < count; i++) 62 | { 63 | LZBFaceSignlePageView *pageView = self.scroollView.subviews[i]; 64 | CGFloat pageViewW = self.scroollView.bounds.size.width; 65 | CGFloat pageViewH = self.scroollView.bounds.size.height; 66 | CGFloat pageViewY = 0; 67 | CGFloat pageViewX = pageViewW * i; 68 | pageView.frame = CGRectMake(pageViewX, pageViewY, pageViewW, pageViewH); 69 | } 70 | 71 | self.scroollView.contentSize = CGSizeMake(self.scroollView.bounds.size.width * count, 0); 72 | 73 | } 74 | 75 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 76 | { 77 | double pageNo = scrollView.contentOffset.x / scrollView.bounds.size.width; 78 | self.pageControl.currentPage = (int)(pageNo + 0.5); 79 | } 80 | 81 | #pragma mark - handle 82 | - (void)setEmojiModles:(NSArray *)emojiModles selectEmojiModelBlock:(void(^)(LZBEmojiModel*selectModel))selectBlock deleteBlcok:(void(^)())deleteBlcok sendBlcok:(void(^)())sendBlock 83 | { 84 | self.emojiDidSendBlock = sendBlock; 85 | self.emojiDidDeleteBlock = deleteBlcok; 86 | self.emojiDidSelectBlock = selectBlock; 87 | self.emojiModles = emojiModles; 88 | } 89 | 90 | - (void)sendButtonClick 91 | { 92 | if(self.emojiDidSendBlock) 93 | self.emojiDidSendBlock(); 94 | } 95 | 96 | - (void)setEmojiModles:(NSArray *)emojiModles 97 | { 98 | _emojiModles = emojiModles; 99 | [self.scroollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 100 | 101 | NSInteger pageCount = (emojiModles.count + LZBFaceSignlePageView_AllEmjoiCount - 1)/LZBFaceSignlePageView_AllEmjoiCount; 102 | self.pageControl.numberOfPages = pageCount; 103 | for (NSInteger i = 0; i < pageCount; i++) 104 | { 105 | LZBFaceSignlePageView *pageView = [[LZBFaceSignlePageView alloc]init]; 106 | pageView.emojiDidDeleteBlock = self.emojiDidDeleteBlock; 107 | pageView.emojiDidSelectBlock = self.emojiDidSelectBlock; 108 | NSRange range; 109 | range.location = i * LZBFaceSignlePageView_AllEmjoiCount; 110 | NSInteger remainCount = emojiModles.count - range.location; 111 | if(remainCount >= LZBFaceSignlePageView_AllEmjoiCount) 112 | range.length = LZBFaceSignlePageView_AllEmjoiCount; 113 | else 114 | range.length = remainCount; 115 | pageView.emojiSignlePageModles = [emojiModles subarrayWithRange:range]; 116 | [self.scroollView addSubview:pageView]; 117 | } 118 | [self setNeedsLayout]; 119 | } 120 | 121 | #pragma mark - lazy 122 | - (UIScrollView *)scroollView 123 | { 124 | if(_scroollView == nil) 125 | { 126 | _scroollView = [[UIScrollView alloc]init]; 127 | _scroollView.pagingEnabled = YES; 128 | _scroollView.delegate = self; 129 | _scroollView.showsHorizontalScrollIndicator = NO; 130 | _scroollView.showsVerticalScrollIndicator = NO; 131 | } 132 | return _scroollView; 133 | } 134 | 135 | - (UIPageControl *)pageControl 136 | { 137 | if(_pageControl == nil) 138 | { 139 | _pageControl = [[UIPageControl alloc]init]; 140 | _pageControl.hidesForSinglePage = YES; 141 | _pageControl.userInteractionEnabled = NO; 142 | _pageControl.currentPageIndicatorTintColor =[UIColor blueColor]; 143 | _pageControl.pageIndicatorTintColor = [UIColor grayColor]; 144 | } 145 | return _pageControl; 146 | } 147 | - (UIButton *)sendButton{ 148 | if (_sendButton == nil) { 149 | _sendButton = [[UIButton alloc] init]; 150 | [_sendButton setImage:LZBKeyboardBundleImage(@"btn_comment_expression_send") forState:UIControlStateNormal]; 151 | [_sendButton addTarget:self action:@selector(sendButtonClick) forControlEvents:UIControlEventTouchUpInside]; 152 | } 153 | return _sendButton; 154 | } 155 | 156 | 157 | @end 158 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/UIViewController+LZBKeyBoardObserver.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+LZBKeyBoardObserver.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/11/30. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "UIViewController+LZBKeyBoardObserver.h" 11 | #import 12 | 13 | CGFloat _lzb_keyBoard_DefaultMargin = lzb_settingKeyBoard_DefaultMargin; 14 | static NSObject *_keyboardWillShowObser; 15 | static NSObject *_keyboardWillHideObser; 16 | @implementation UIViewController (LZBKeyBoardObserver) 17 | 18 | #pragma mark - API 19 | - (void)lzb_addKeyBoardObserverAutoAdjustHeight 20 | { 21 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 22 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; 23 | } 24 | 25 | - (void)lzb_removeKeyBoardObserver 26 | { 27 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; 28 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; 29 | //键盘手势 30 | [[NSNotificationCenter defaultCenter] removeObserver:_keyboardWillShowObser name:UIKeyboardWillShowNotification object:nil]; 31 | [[NSNotificationCenter defaultCenter] removeObserver:_keyboardWillHideObser name:UIKeyboardWillHideNotification object:nil]; 32 | } 33 | 34 | - (void)lzb_addKeyBoardTapAnyAutoDismissKeyBoard 35 | { 36 | UITapGestureRecognizer *lzbTap = [[UITapGestureRecognizer alloc] initWithTarget:self 37 | action:@selector(tapAnywhereToDismissKeyboard:)]; 38 | NSOperationQueue *mainQuene =[NSOperationQueue mainQueue]; 39 | __weak UIViewController *weakSelf = self; 40 | _keyboardWillShowObser=[[NSNotificationCenter defaultCenter] 41 | addObserverForName:UIKeyboardWillShowNotification 42 | object:nil 43 | queue:mainQuene 44 | usingBlock:^(NSNotification * _Nonnull note) { 45 | [weakSelf.view addGestureRecognizer:lzbTap]; 46 | }]; 47 | 48 | _keyboardWillHideObser = [[NSNotificationCenter defaultCenter] 49 | addObserverForName:UIKeyboardWillHideNotification 50 | object:nil 51 | queue:mainQuene 52 | usingBlock:^(NSNotification *note){ 53 | [weakSelf.view removeGestureRecognizer:lzbTap]; 54 | }]; 55 | } 56 | 57 | 58 | #pragma mark - handel 59 | - (void)tapAnywhereToDismissKeyboard:(UIGestureRecognizer *)gestureRecognizer { 60 | [self.view endEditing:YES]; 61 | } 62 | - (void)keyboardWillShow:(NSNotification *)notification 63 | { 64 | //获取键盘的参数 65 | CGFloat keyboardHeight = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue].size.height; 66 | CGFloat keyboardAnimaitonDuration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 67 | NSInteger option = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; 68 | //移除之前的动画 69 | [self.view.layer removeAllAnimations]; 70 | 71 | UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; 72 | //找出第一响应者 73 | UIView *firstResponseView = [self findFirstResponderWithView:self.view]; 74 | CGRect rect = [keyWindow convertRect:firstResponseView.frame fromView:firstResponseView.superview]; 75 | //计算第一响应者与键盘弹出的差值,滚动距离 76 | CGFloat firstResponseViewMaxY= CGRectGetMaxY(rect); 77 | CGFloat keyBoardY = keyWindow.bounds.size.height - keyboardHeight; 78 | CGFloat keyBoardResponseViewMargin = firstResponseViewMaxY - keyBoardY; 79 | //如果响应者的最大Y值 > 键盘的Y值才滚动 80 | _lzb_keyBoard_DefaultMargin = 0; 81 | if(firstResponseViewMaxY > keyBoardY) 82 | { 83 | //设置lzb_settingKeyBoard_DefaultMargin固定距离(就是滚动后的间距) 84 | _lzb_keyBoard_DefaultMargin = lzb_settingKeyBoard_DefaultMargin; 85 | _lzb_keyBoard_DefaultMargin +=keyBoardResponseViewMargin; 86 | 87 | //滚动动画 88 | __weak UIViewController *weakSelf = self; 89 | [UIView animateKeyframesWithDuration:keyboardAnimaitonDuration 90 | delay:0 91 | options:option 92 | animations:^{ 93 | CGRect frame = weakSelf.view.frame; 94 | frame.origin.y -= _lzb_keyBoard_DefaultMargin; 95 | weakSelf.view.frame = frame; 96 | 97 | } completion:nil]; 98 | } 99 | 100 | } 101 | 102 | - (void)keyboardWillHide:(NSNotification *)notification 103 | { 104 | //获取键盘的参数 105 | CGFloat keyboardAnimaitonDuration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 106 | NSInteger option = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; 107 | __weak UIViewController *weakSelf = self; 108 | //滚动动画 109 | [UIView animateWithDuration:keyboardAnimaitonDuration 110 | delay:0 111 | options:option 112 | animations:^{ 113 | CGRect frame = weakSelf.view.frame; 114 | frame.origin.y += _lzb_keyBoard_DefaultMargin; 115 | weakSelf.view.frame = frame; 116 | } 117 | completion:nil]; 118 | //注意:一定要清0,因为不知道下一次响应者是位置 119 | _lzb_keyBoard_DefaultMargin = 0; 120 | } 121 | - (UIView *)findFirstResponderWithView:(UIView *)view 122 | { 123 | if(self.isFirstResponder) 124 | return self.view; 125 | for (UIView *subView in view.subviews) 126 | { 127 | if(subView.isFirstResponder) 128 | return subView; 129 | else 130 | continue; 131 | } 132 | return view; 133 | } 134 | 135 | 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolBar.m 3 | // LZBKeyBoardView 4 | // 5 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 6 | // Created by zibin on 16/12/4. 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBKeyBoardToolBar.h" 11 | #import "LZBTextView.h" 12 | #import "UIView+LZBViewFrame.h" 13 | 14 | //颜色转换 15 | #define LZBColorRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] 16 | #define LZBKeyboardBundleImage(name) [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",@"Resource.bundle/",name]] 17 | 18 | #define kKeyboardViewToolBarHeight 50 // 默认键盘输入工具条的高度 19 | #define kKeyboardViewToolBar_TextView_Height 35 // 默认键盘输入框的高度 20 | #define kKeyboardViewToolBar_TextView_LimitHeight 60 // 默认键盘输入框的限制高度 21 | #define kKeyboardViewToolBar_SendBtn_Width 40 // 默认发送按钮的宽度 22 | #define kKeyboardViewToolBar_Horizontal_DefaultMargin 15 //水平方向默认间距 23 | #define kKeyboardViewToolBar_Vertical_DefaultMargin 8 //垂直方向默认间距 24 | #define LZBScreenHeight [UIScreen mainScreen].bounds.size.height 25 | #define LZBScreenWidth [UIScreen mainScreen].bounds.size.width 26 | #define inputextViewFont [UIFont systemFontOfSize:14.0] 27 | 28 | @interface LZBKeyBoardToolBar() 29 | //View 30 | @property (nonatomic, strong) LZBTextView *inputTextView; //输入框 31 | @property (nonatomic, strong) UIView *topLine; // 顶部分割线 32 | @property (nonatomic, strong) UIView *bottomLine; // 底部分割线 33 | @property (nonatomic, strong) UIButton *sendBtn; // 发送按钮 34 | 35 | //data 36 | @property (nonatomic, copy) void(^sendTextBlock)(NSString *text); //输入框输入字符串回调Blcok 37 | @property (nonatomic, assign) CGFloat textHeight; //输入文字高度 38 | @property (nonatomic, assign) CGFloat animationDuration; //动画时间 39 | @property (nonatomic, strong) NSString *placeHolder; //占位文字 40 | 41 | 42 | @end 43 | 44 | @implementation LZBKeyBoardToolBar 45 | 46 | #pragma mark - API 47 | + (LZBKeyBoardToolBar *)showKeyBoardWithConfigToolBarHeight:(CGFloat)toolBarHeight sendTextCompletion:(void(^)(NSString *sendText))sendTextBlock 48 | { 49 | LZBKeyBoardToolBar *toolBar = [[LZBKeyBoardToolBar alloc]init]; 50 | toolBar.backgroundColor = LZBColorRGB(247, 248, 250); 51 | if(toolBarHeight < kKeyboardViewToolBarHeight) 52 | toolBarHeight = kKeyboardViewToolBarHeight; 53 | toolBar.frame = CGRectMake(0, LZBScreenHeight - toolBarHeight, LZBScreenWidth, toolBarHeight); 54 | toolBar.sendTextBlock = sendTextBlock; 55 | return toolBar; 56 | 57 | } 58 | - (void)setInputViewPlaceHolderText:(NSString *)placeText 59 | { 60 | self.inputTextView.placeholder = placeText; 61 | self.placeHolder = placeText; 62 | } 63 | - (void)becomeFirstResponder{ 64 | [self.inputTextView becomeFirstResponder]; 65 | self.hidden = NO; 66 | } 67 | 68 | - (void)resignFirstResponder{ 69 | [self.inputTextView resignFirstResponder]; 70 | } 71 | 72 | 73 | #pragma mark - private 74 | - (instancetype)initWithFrame:(CGRect)frame 75 | { 76 | if(self = [super initWithFrame:frame]) 77 | { 78 | [self setupUI]; 79 | } 80 | return self; 81 | } 82 | 83 | - (void)setupUI 84 | { 85 | [self addSubview:self.inputTextView]; 86 | [self addSubview:self.topLine]; 87 | [self addSubview:self.bottomLine]; 88 | [self addSubview:self.sendBtn]; 89 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil]; 90 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange) name:UITextViewTextDidChangeNotification object:self.inputTextView]; 91 | } 92 | 93 | - (void)layoutSubviews 94 | { 95 | [super layoutSubviews]; 96 | __weak typeof(self) weakSelf = self; 97 | 98 | CGFloat height = (self.textHeight + kKeyboardViewToolBar_TextView_Height)> kKeyboardViewToolBarHeight ? (self.textHeight + kKeyboardViewToolBar_TextView_Height) : kKeyboardViewToolBarHeight; 99 | CGFloat offsetY = self.LZB_heigth - height; 100 | [UIView animateWithDuration:self.animationDuration animations:^{ 101 | weakSelf.LZB_y += offsetY; 102 | weakSelf.LZB_heigth = height; 103 | }]; 104 | 105 | self.topLine.LZB_width = self.LZB_width; 106 | self.bottomLine.LZB_width = self.LZB_width; 107 | 108 | 109 | CGSize sendButtonSize = self.sendBtn.currentImage.size; 110 | self.sendBtn.LZB_width = sendButtonSize.width; 111 | self.sendBtn.LZB_heigth = sendButtonSize.height; 112 | self.sendBtn.LZB_x = self.LZB_width - sendButtonSize.width - kKeyboardViewToolBar_Horizontal_DefaultMargin; 113 | 114 | 115 | self.inputTextView.LZB_width = self.LZB_width - sendButtonSize.width - 3 *kKeyboardViewToolBar_Horizontal_DefaultMargin; 116 | self.inputTextView.LZB_x = kKeyboardViewToolBar_Horizontal_DefaultMargin; 117 | 118 | 119 | [UIView animateWithDuration:self.animationDuration animations:^{ 120 | weakSelf.inputTextView.LZB_heigth = weakSelf.LZB_heigth - 2 *kKeyboardViewToolBar_Vertical_DefaultMargin; 121 | weakSelf.inputTextView.LZB_centerY = weakSelf.LZB_heigth * 0.5; 122 | weakSelf.sendBtn.LZB_y = weakSelf.LZB_heigth - sendButtonSize.height -kKeyboardViewToolBar_Vertical_DefaultMargin; 123 | weakSelf.bottomLine.LZB_y = weakSelf.LZB_heigth - weakSelf.bottomLine.LZB_heigth; 124 | }]; 125 | 126 | [self.inputTextView setNeedsUpdateConstraints]; 127 | } 128 | 129 | 130 | 131 | #pragma mark - handle 132 | - (void)keyboardWillChangeFrame:(NSNotification *)notification 133 | { 134 | CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 135 | CGFloat keyboardHeight = keyboardFrame.size.height; 136 | CGFloat keyboardAnimaitonDuration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 137 | self.animationDuration = keyboardAnimaitonDuration; 138 | NSInteger option = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; 139 | 140 | //判断键盘是否出现 141 | BOOL isKeyBoardHidden = LZBScreenHeight == keyboardFrame.origin.y; 142 | CGFloat offsetMarginY = isKeyBoardHidden ? LZBScreenHeight - self.LZB_heigth :LZBScreenHeight - self.LZB_heigth - keyboardHeight; 143 | 144 | [UIView animateKeyframesWithDuration:self.animationDuration delay:0 options:option animations:^{ 145 | self.LZB_y = offsetMarginY; 146 | } completion:nil]; 147 | 148 | } 149 | 150 | - (void)textDidChange 151 | { 152 | if([self.inputTextView.text containsString:@"\n"]) 153 | { 154 | [self sendBtnClick]; 155 | return; 156 | } 157 | 158 | CGFloat margin = self.inputTextView.textContainerInset.left + self.inputTextView.textContainerInset.right; 159 | 160 | CGFloat height = [self.inputTextView.text boundingRectWithSize:CGSizeMake(self.inputTextView.LZB_width - margin, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : self.inputTextView.font} context:nil].size.height; 161 | 162 | if(height == self.textHeight) return; 163 | 164 | // 确保输入框不会无限增高,控制在显示4行 165 | if (height > kKeyboardViewToolBar_TextView_LimitHeight) { 166 | return; 167 | } 168 | self.textHeight = height; 169 | 170 | [self setNeedsLayout]; 171 | } 172 | 173 | - (void)sendBtnClick 174 | { 175 | if(self.sendTextBlock) 176 | self.sendTextBlock(self.inputTextView.text); 177 | self.textHeight = 0; 178 | [self resetInputView]; 179 | } 180 | 181 | - (void)resetInputView 182 | { 183 | self.inputTextView.text = @""; 184 | [self setInputViewPlaceHolderText:self.placeHolder.length > 0 ? self.placeHolder : @""]; 185 | [self.inputTextView resignFirstResponder]; 186 | self.inputTextView.placeHolderHidden = self.inputTextView.hasText; 187 | } 188 | 189 | 190 | #pragma mark - lazy 191 | - (UIButton *)sendBtn 192 | { 193 | if(_sendBtn == nil) 194 | { 195 | _sendBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 196 | [_sendBtn setImage:LZBKeyboardBundleImage(@"btn_comment_expression_send") forState:UIControlStateNormal]; 197 | [_sendBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; 198 | [_sendBtn addTarget:self action:@selector(sendBtnClick) forControlEvents:UIControlEventTouchUpInside]; 199 | } 200 | return _sendBtn; 201 | } 202 | - (LZBTextView *)inputTextView 203 | { 204 | if(_inputTextView == nil) 205 | { 206 | _inputTextView = [[LZBTextView alloc]init]; 207 | _inputTextView.layer.cornerRadius = 4; 208 | _inputTextView.layer.masksToBounds = YES; 209 | _inputTextView.layer.borderWidth = 1; 210 | _inputTextView.layer.borderColor = LZBColorRGB(221, 221, 221).CGColor; 211 | _inputTextView.font = inputextViewFont; 212 | _inputTextView.textColor = LZBColorRGB(102, 102, 102); 213 | _inputTextView.tintColor = _inputTextView.textColor; 214 | _inputTextView.enablesReturnKeyAutomatically = YES; 215 | _inputTextView.returnKeyType = UIReturnKeySend; 216 | _inputTextView.placeholderColor = LZBColorRGB(150, 150, 150); 217 | } 218 | return _inputTextView; 219 | } 220 | 221 | - (UIView *)topLine{ 222 | if (_topLine == nil) { 223 | _topLine = [[UIView alloc] init]; 224 | _topLine.LZB_heigth = 0.5; 225 | _topLine.backgroundColor = LZBColorRGB(214, 214, 214); 226 | } 227 | return _topLine; 228 | } 229 | 230 | - (UIView *)bottomLine{ 231 | if (_bottomLine == nil) { 232 | _bottomLine = [[UIView alloc] init]; 233 | _bottomLine.backgroundColor = LZBColorRGB(214, 214, 214); 234 | _bottomLine.LZB_heigth = 0.5; 235 | _bottomLine.hidden = YES; 236 | } 237 | return _bottomLine; 238 | } 239 | @end 240 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/Resource.bundle/emoji.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | code 7 | 0x1f603 8 | type 9 | 1 10 | 11 | 12 | code 13 | 0x1f60d 14 | type 15 | 1 16 | 17 | 18 | code 19 | 0x1f612 20 | type 21 | 1 22 | 23 | 24 | code 25 | 0x1f633 26 | type 27 | 1 28 | 29 | 30 | code 31 | 0x1f601 32 | type 33 | 1 34 | 35 | 36 | code 37 | 0x1f618 38 | type 39 | 1 40 | 41 | 42 | code 43 | 0x1f609 44 | type 45 | 1 46 | 47 | 48 | code 49 | 0x1f620 50 | type 51 | 1 52 | 53 | 54 | code 55 | 0x1f61e 56 | type 57 | 1 58 | 59 | 60 | code 61 | 0x1f625 62 | type 63 | 1 64 | 65 | 66 | code 67 | 0x1f62d 68 | type 69 | 1 70 | 71 | 72 | code 73 | 0x1f61d 74 | type 75 | 1 76 | 77 | 78 | code 79 | 0x1f621 80 | type 81 | 1 82 | 83 | 84 | code 85 | 0x1f623 86 | type 87 | 1 88 | 89 | 90 | code 91 | 0x1f614 92 | type 93 | 1 94 | 95 | 96 | code 97 | 0x1f604 98 | type 99 | 1 100 | 101 | 102 | code 103 | 0x1f637 104 | type 105 | 1 106 | 107 | 108 | code 109 | 0x1f61a 110 | type 111 | 1 112 | 113 | 114 | code 115 | 0x1f613 116 | type 117 | 1 118 | 119 | 120 | code 121 | 0x1f602 122 | type 123 | 1 124 | 125 | 126 | code 127 | 0x1f60a 128 | type 129 | 1 130 | 131 | 132 | code 133 | 0x1f622 134 | type 135 | 1 136 | 137 | 138 | code 139 | 0x1f61c 140 | type 141 | 1 142 | 143 | 144 | code 145 | 0x1f628 146 | type 147 | 1 148 | 149 | 150 | code 151 | 0x1f630 152 | type 153 | 1 154 | 155 | 156 | code 157 | 0x1f632 158 | type 159 | 1 160 | 161 | 162 | code 163 | 0x1f60f 164 | type 165 | 1 166 | 167 | 168 | code 169 | 0x1f631 170 | type 171 | 1 172 | 173 | 174 | code 175 | 0x1f62a 176 | type 177 | 1 178 | 179 | 180 | code 181 | 0x1f616 182 | type 183 | 1 184 | 185 | 186 | code 187 | 0x1f60c 188 | type 189 | 1 190 | 191 | 192 | code 193 | 0x1f47f 194 | type 195 | 1 196 | 197 | 198 | code 199 | 0x1f47b 200 | type 201 | 1 202 | 203 | 204 | code 205 | 0x1f385 206 | type 207 | 1 208 | 209 | 210 | code 211 | 0x1f467 212 | type 213 | 1 214 | 215 | 216 | code 217 | 0x1f466 218 | type 219 | 1 220 | 221 | 222 | code 223 | 0x1f469 224 | type 225 | 1 226 | 227 | 228 | code 229 | 0x1f468 230 | type 231 | 1 232 | 233 | 234 | code 235 | 0x1f436 236 | type 237 | 1 238 | 239 | 240 | code 241 | 0x1f431 242 | type 243 | 1 244 | 245 | 246 | code 247 | 0x1f44d 248 | type 249 | 1 250 | 251 | 252 | code 253 | 0x1f44e 254 | type 255 | 1 256 | 257 | 258 | code 259 | 0x1f44a 260 | type 261 | 1 262 | 263 | 264 | code 265 | 0x270a 266 | type 267 | 1 268 | 269 | 270 | code 271 | 0x270c 272 | type 273 | 1 274 | 275 | 276 | code 277 | 0x1f4aa 278 | type 279 | 1 280 | 281 | 282 | code 283 | 0x1f44f 284 | type 285 | 1 286 | 287 | 288 | code 289 | 0x1f448 290 | type 291 | 1 292 | 293 | 294 | code 295 | 0x1f446 296 | type 297 | 1 298 | 299 | 300 | code 301 | 0x1f449 302 | type 303 | 1 304 | 305 | 306 | code 307 | 0x1f447 308 | type 309 | 1 310 | 311 | 312 | code 313 | 0x1f44c 314 | type 315 | 1 316 | 317 | 318 | code 319 | 0x2764 320 | type 321 | 1 322 | 323 | 324 | code 325 | 0x1f494 326 | type 327 | 1 328 | 329 | 330 | code 331 | 0x1f64f 332 | type 333 | 1 334 | 335 | 336 | code 337 | 0x2600 338 | type 339 | 1 340 | 341 | 342 | code 343 | 0x1f319 344 | type 345 | 1 346 | 347 | 348 | code 349 | 0x1f31f 350 | type 351 | 1 352 | 353 | 354 | code 355 | 0x26a1 356 | type 357 | 1 358 | 359 | 360 | code 361 | 0x2601 362 | type 363 | 1 364 | 365 | 366 | code 367 | 0x2614 368 | type 369 | 1 370 | 371 | 372 | code 373 | 0x1f341 374 | type 375 | 1 376 | 377 | 378 | code 379 | 0x1f33b 380 | type 381 | 1 382 | 383 | 384 | code 385 | 0x1f343 386 | type 387 | 1 388 | 389 | 390 | code 391 | 0x1f457 392 | type 393 | 1 394 | 395 | 396 | code 397 | 0x1f380 398 | type 399 | 1 400 | 401 | 402 | code 403 | 0x1f444 404 | type 405 | 1 406 | 407 | 408 | code 409 | 0x1f339 410 | type 411 | 1 412 | 413 | 414 | code 415 | 0x2615 416 | type 417 | 1 418 | 419 | 420 | code 421 | 0x1f382 422 | type 423 | 1 424 | 425 | 426 | code 427 | 0x1f559 428 | type 429 | 1 430 | 431 | 432 | code 433 | 0x1f37a 434 | type 435 | 1 436 | 437 | 438 | code 439 | 0x1f50d 440 | type 441 | 1 442 | 443 | 444 | code 445 | 0x1f4f1 446 | type 447 | 1 448 | 449 | 450 | code 451 | 0x1f3e0 452 | type 453 | 1 454 | 455 | 456 | code 457 | 0x1f697 458 | type 459 | 1 460 | 461 | 462 | code 463 | 0x1f381 464 | type 465 | 1 466 | 467 | 468 | code 469 | 0x26bd 470 | type 471 | 1 472 | 473 | 474 | code 475 | 0x1f4a3 476 | type 477 | 1 478 | 479 | 480 | code 481 | 0x1f48e 482 | type 483 | 1 484 | 485 | 486 | 487 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardView/LZBKeyBoardToolEmojiBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // LZBKeyBoardToolEmojiBar.m 3 | // LZBKeyBoardView 4 | // 5 | // Created by zibin on 16/12/6. 6 | // demo地址:https://github.com/lzbgithubcode/LZBKeyBoardView.git 7 | // Copyright © 2016年 apple. All rights reserved. 8 | // 9 | 10 | #import "LZBKeyBoardToolEmojiBar.h" 11 | #import "LZBTextView.h" 12 | #import "UIView+LZBViewFrame.h" 13 | #import "LZBFaceView.h" 14 | #import "NSString+LZBTranscoding.h" 15 | 16 | //颜色转换 17 | #define LZBColorRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] 18 | //获取图片资源 19 | #define LZBKeyboardBundleImage(name) [UIImage imageNamed:[NSString stringWithFormat:@"%@%@",@"Resource.bundle/",name]] 20 | 21 | #define kKeyboardView_FaceViewHeight 216 // 表情键盘高度 22 | #define kKeyboardViewToolBarHeight 50 // 默认键盘输入工具条的高度 23 | #define kKeyboardViewToolBar_TextView_Height 35 // 默认键盘输入框的高度 24 | #define kKeyboardViewToolBar_TextView_LimitHeight 60 // 默认键盘输入框的限制高度 25 | #define kKeyboardViewToolBar_SendBtn_Width 40 // 默认发送按钮的宽度 26 | #define kKeyboardViewToolBar_Horizontal_DefaultMargin 15 //水平方向默认间距 27 | #define kKeyboardViewToolBar_Vertical_DefaultMargin 8 //垂直方向默认间距 28 | #define LZBScreenHeight [UIScreen mainScreen].bounds.size.height 29 | #define LZBScreenWidth [UIScreen mainScreen].bounds.size.width 30 | #define inputextViewFont [UIFont systemFontOfSize:14.0] 31 | 32 | @interface LZBKeyBoardToolEmojiBar() 33 | //View 34 | @property (nonatomic, strong) LZBTextView *inputTextView; //输入框 35 | @property (nonatomic, strong) UIView *topLine; // 顶部分割线 36 | @property (nonatomic, strong) UIView *bottomLine; // 底部分割线 37 | @property (nonatomic, strong) UIButton *faceButton; // 按钮 38 | @property (nonatomic, strong) LZBFaceView *faceView; 39 | 40 | //data 41 | @property (nonatomic, copy) void(^sendTextBlock)(NSString *text); //输入框输入字符串回调Blcok 42 | @property (nonatomic, assign) CGFloat textHeight; //输入文字高度 43 | @property (nonatomic, assign) CGFloat animationDuration; //动画时间 44 | @property (nonatomic, strong) NSString *placeHolder; //占位文字 45 | @end 46 | 47 | @implementation LZBKeyBoardToolEmojiBar 48 | #pragma mark - API 49 | + (LZBKeyBoardToolEmojiBar *)showKeyBoardWithConfigToolBarHeight:(CGFloat)toolBarHeight sendTextCompletion:(void(^)(NSString *sendText))sendTextBlock 50 | { 51 | LZBKeyBoardToolEmojiBar *toolBar = [[LZBKeyBoardToolEmojiBar alloc]init]; 52 | toolBar.backgroundColor = LZBColorRGB(247, 248, 250); 53 | if(toolBarHeight < kKeyboardViewToolBarHeight) 54 | toolBarHeight = kKeyboardViewToolBarHeight; 55 | toolBar.frame = CGRectMake(0, LZBScreenHeight - toolBarHeight, LZBScreenWidth, toolBarHeight); 56 | toolBar.sendTextBlock = sendTextBlock; 57 | return toolBar; 58 | 59 | } 60 | - (void)setInputViewPlaceHolderText:(NSString *)placeText 61 | { 62 | self.inputTextView.placeholder = placeText; 63 | self.placeHolder = placeText; 64 | } 65 | - (void)becomeFirstResponder{ 66 | [self.inputTextView becomeFirstResponder]; 67 | self.hidden = NO; 68 | } 69 | 70 | - (void)resignFirstResponder{ 71 | [self.inputTextView resignFirstResponder]; 72 | } 73 | 74 | 75 | #pragma mark - private 76 | - (instancetype)initWithFrame:(CGRect)frame 77 | { 78 | if(self = [super initWithFrame:frame]) 79 | { 80 | [self setupUI]; 81 | } 82 | return self; 83 | } 84 | 85 | - (void)setupUI 86 | { 87 | [self addSubview:self.inputTextView]; 88 | [self addSubview:self.topLine]; 89 | [self addSubview:self.bottomLine]; 90 | [self addSubview:self.faceButton]; 91 | __weak typeof(self) weakSelf = self; 92 | [self.faceView setEmojiModles:[self loadEmojiEmotions] selectEmojiModelBlock:^(LZBEmojiModel *selectModel) { 93 | [weakSelf emojitionDidSelect:selectModel]; 94 | } deleteBlcok:^{ 95 | [weakSelf emojitionDidDelete]; 96 | } sendBlcok:^{ 97 | [weakSelf emojitionDidSend]; 98 | }]; 99 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil]; 100 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange) name:UITextViewTextDidChangeNotification object:self.inputTextView]; 101 | } 102 | 103 | - (void)layoutSubviews 104 | { 105 | [super layoutSubviews]; 106 | __weak typeof(self) weakSelf = self; 107 | 108 | CGFloat height = (self.textHeight + kKeyboardViewToolBar_TextView_Height)> kKeyboardViewToolBarHeight ? (self.textHeight + kKeyboardViewToolBar_TextView_Height) : kKeyboardViewToolBarHeight; 109 | CGFloat offsetY = self.LZB_heigth - height; 110 | [UIView animateWithDuration:self.animationDuration animations:^{ 111 | weakSelf.LZB_y += offsetY; 112 | weakSelf.LZB_heigth = height; 113 | }]; 114 | 115 | self.topLine.LZB_width = self.LZB_width; 116 | self.bottomLine.LZB_width = self.LZB_width; 117 | 118 | 119 | CGSize sendButtonSize = self.faceButton.currentImage.size; 120 | self.faceButton.LZB_width = sendButtonSize.width; 121 | self.faceButton.LZB_heigth = sendButtonSize.height; 122 | self.faceButton.LZB_x = self.LZB_width - sendButtonSize.width - kKeyboardViewToolBar_Horizontal_DefaultMargin; 123 | 124 | 125 | self.inputTextView.LZB_width = self.LZB_width - sendButtonSize.width - 3 *kKeyboardViewToolBar_Horizontal_DefaultMargin; 126 | self.inputTextView.LZB_x = kKeyboardViewToolBar_Horizontal_DefaultMargin; 127 | 128 | 129 | [UIView animateWithDuration:self.animationDuration animations:^{ 130 | weakSelf.inputTextView.LZB_heigth = weakSelf.LZB_heigth - 2 *kKeyboardViewToolBar_Vertical_DefaultMargin; 131 | weakSelf.inputTextView.LZB_centerY = weakSelf.LZB_heigth * 0.5; 132 | weakSelf.faceButton.LZB_y = weakSelf.LZB_heigth - sendButtonSize.height -kKeyboardViewToolBar_Vertical_DefaultMargin; 133 | weakSelf.bottomLine.LZB_y = weakSelf.LZB_heigth - weakSelf.bottomLine.LZB_heigth; 134 | }]; 135 | 136 | [self.inputTextView setNeedsUpdateConstraints]; 137 | } 138 | 139 | 140 | 141 | #pragma mark - handle 142 | - (void)keyboardWillChangeFrame:(NSNotification *)notification 143 | { 144 | CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 145 | CGFloat keyboardHeight = keyboardFrame.size.height; 146 | CGFloat keyboardAnimaitonDuration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 147 | self.animationDuration = keyboardAnimaitonDuration; 148 | NSInteger option = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; 149 | 150 | // 普通文本键盘与表情键盘切换时,过滤 151 | BOOL isEmojiKeyBoard = !self.faceButton.selected &&keyboardFrame.size.height == kKeyboardView_FaceViewHeight; 152 | BOOL isNormalKeyBoard = self.faceButton.selected &&keyboardFrame.size.height != kKeyboardView_FaceViewHeight; 153 | if(isEmojiKeyBoard || isNormalKeyBoard) return; 154 | 155 | //判断键盘是否出现 156 | BOOL isKeyBoardHidden = LZBScreenHeight == keyboardFrame.origin.y; 157 | CGFloat offsetMarginY = isKeyBoardHidden ? LZBScreenHeight - self.LZB_heigth :LZBScreenHeight - self.LZB_heigth - keyboardHeight; 158 | 159 | [UIView animateKeyframesWithDuration:self.animationDuration delay:0 options:option animations:^{ 160 | self.LZB_y = offsetMarginY; 161 | } completion:nil]; 162 | 163 | } 164 | 165 | - (void)textDidChange 166 | { 167 | //注意:点击发送之后是先收到这个通知,收到通知的时候hasText = YES,让后再text = @"",所以在inputTextView里面的监听无效 168 | self.inputTextView.placeHolderHidden = self.inputTextView.hasText; 169 | if([self.inputTextView.text containsString:@"\n"]) 170 | { 171 | [self emojitionDidSend]; 172 | return; 173 | } 174 | 175 | CGFloat margin = self.inputTextView.textContainerInset.left + self.inputTextView.textContainerInset.right; 176 | 177 | CGFloat height = [self.inputTextView.text boundingRectWithSize:CGSizeMake(self.inputTextView.LZB_width - margin, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : self.inputTextView.font} context:nil].size.height; 178 | 179 | if(height == self.textHeight) return; 180 | 181 | // 确保输入框不会无限增高,控制在显示4行 182 | if (height > kKeyboardViewToolBar_TextView_LimitHeight) { 183 | return; 184 | } 185 | self.textHeight = height; 186 | 187 | [self setNeedsLayout]; 188 | } 189 | 190 | - (void)faceButtonClick:(UIButton *)faceButton 191 | { 192 | faceButton.selected = !faceButton.isSelected; 193 | self.bottomLine.hidden = !faceButton.selected; 194 | [self.inputTextView resignFirstResponder]; 195 | self.inputTextView.inputView = faceButton.selected?self.faceView : nil; 196 | [self.inputTextView becomeFirstResponder]; 197 | } 198 | 199 | - (void)emojitionDidSelect:(LZBEmojiModel *)emojiModel 200 | { 201 | self.inputTextView.text = [self.inputTextView.text stringByAppendingString:emojiModel.code.emoji]; 202 | [self textDidChange]; 203 | } 204 | 205 | - (void)emojitionDidDelete 206 | { 207 | [self.inputTextView deleteBackward]; 208 | } 209 | 210 | - (void)emojitionDidSend 211 | { 212 | NSString *text = self.inputTextView.text; 213 | if(self.sendTextBlock) 214 | self.sendTextBlock(text); 215 | [self resetInputView]; 216 | [self textDidChange]; 217 | 218 | } 219 | 220 | - (void)resetInputView 221 | { 222 | self.inputTextView.text = @""; 223 | [self setInputViewPlaceHolderText:self.placeHolder.length > 0 ? self.placeHolder : @""]; 224 | [self.inputTextView resignFirstResponder]; 225 | if(self.faceButton.selected) 226 | { 227 | self.faceButton.selected = !self.faceButton.isSelected; 228 | self.bottomLine.hidden = !self.faceButton.selected; 229 | self.inputTextView.inputView = self.faceButton.selected?self.faceView : nil; 230 | } 231 | 232 | //布局的目的是布局textContainer 显示区域,显示区域回到初始位置 233 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 234 | [self setNeedsLayout]; 235 | }); 236 | } 237 | 238 | 239 | 240 | #pragma mark - lazy 241 | 242 | - (NSArray *)loadEmojiEmotions{ 243 | 244 | NSString *path = [[NSBundle mainBundle] pathForResource:@"Resource.bundle/emoji.plist" ofType:nil]; 245 | 246 | NSArray *emotions = [NSArray arrayWithContentsOfFile:path]; 247 | NSMutableArray *emotionsMul = [NSMutableArray array]; 248 | for (NSDictionary *dic in emotions) { 249 | LZBEmojiModel *model = [[LZBEmojiModel alloc] init]; 250 | [model setValuesForKeysWithDictionary:dic]; 251 | [emotionsMul addObject:model]; 252 | } 253 | return emotionsMul.copy; 254 | } 255 | - (LZBFaceView *)faceView 256 | { 257 | if(_faceView == nil) 258 | { 259 | _faceView = [LZBFaceView new]; 260 | _faceView.backgroundColor = LZBColorRGB(240, 240, 240); 261 | _faceView.frame = CGRectMake(0, 0, LZBScreenWidth, kKeyboardView_FaceViewHeight); 262 | } 263 | return _faceView; 264 | } 265 | - (UIButton *)faceButton 266 | { 267 | if(_faceButton == nil) 268 | { 269 | _faceButton = [UIButton buttonWithType:UIButtonTypeCustom]; 270 | [_faceButton setImage:LZBKeyboardBundleImage(@"iocn_comment_expression") forState:UIControlStateNormal]; 271 | [_faceButton setImage:LZBKeyboardBundleImage(@"iocn_comment_keyboard") forState:UIControlStateSelected]; 272 | [_faceButton addTarget:self action:@selector(faceButtonClick:) forControlEvents:UIControlEventTouchUpInside]; 273 | } 274 | return _faceButton; 275 | } 276 | - (LZBTextView *)inputTextView 277 | { 278 | if(_inputTextView == nil) 279 | { 280 | _inputTextView = [[LZBTextView alloc]init]; 281 | _inputTextView.layer.cornerRadius = 4; 282 | _inputTextView.layer.masksToBounds = YES; 283 | _inputTextView.layer.borderWidth = 1; 284 | _inputTextView.layer.borderColor = LZBColorRGB(221, 221, 221).CGColor; 285 | _inputTextView.font = inputextViewFont; 286 | _inputTextView.textColor = LZBColorRGB(102, 102, 102); 287 | _inputTextView.tintColor = _inputTextView.textColor; 288 | _inputTextView.enablesReturnKeyAutomatically = YES; 289 | _inputTextView.returnKeyType = UIReturnKeySend; 290 | _inputTextView.placeholderColor = LZBColorRGB(150, 150, 150); 291 | } 292 | return _inputTextView; 293 | } 294 | 295 | - (UIView *)topLine{ 296 | if (_topLine == nil) { 297 | _topLine = [[UIView alloc] init]; 298 | _topLine.LZB_heigth = 0.5; 299 | _topLine.backgroundColor = LZBColorRGB(214, 214, 214); 300 | } 301 | return _topLine; 302 | } 303 | 304 | - (UIView *)bottomLine{ 305 | if (_bottomLine == nil) { 306 | _bottomLine = [[UIView alloc] init]; 307 | _bottomLine.backgroundColor = LZBColorRGB(214, 214, 214); 308 | _bottomLine.LZB_heigth = 0.5; 309 | _bottomLine.hidden = YES; 310 | } 311 | return _bottomLine; 312 | } 313 | 314 | 315 | 316 | @end 317 | -------------------------------------------------------------------------------- /LZBKeyBoardView/LZBKeyBoardView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 18A667B41DF40F6A00BC6664 /* LZBKeyBoardToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 18A667B31DF40F6A00BC6664 /* LZBKeyBoardToolBar.m */; }; 11 | 18A667B71DF415DE00BC6664 /* UIView+LZBViewFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 18A667B61DF415DE00BC6664 /* UIView+LZBViewFrame.m */; }; 12 | 18A667C61DF445C900BC6664 /* LZBKeyBoardToolVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 18A667C51DF445C900BC6664 /* LZBKeyBoardToolVC.m */; }; 13 | 18D81EC81DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D81EC71DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.m */; }; 14 | 18D81ECB1DEEF7A8007456A0 /* LZBAutoAdjustViewVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D81ECA1DEEF7A8007456A0 /* LZBAutoAdjustViewVC.m */; }; 15 | 18E5711D1DEDB93F0048F386 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E5711C1DEDB93F0048F386 /* main.m */; }; 16 | 18E571201DEDB93F0048F386 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E5711F1DEDB93F0048F386 /* AppDelegate.m */; }; 17 | 18E571231DEDB93F0048F386 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E571221DEDB93F0048F386 /* ViewController.m */; }; 18 | 18E571261DEDB93F0048F386 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18E571241DEDB93F0048F386 /* Main.storyboard */; }; 19 | 18E571281DEDB93F0048F386 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18E571271DEDB93F0048F386 /* Assets.xcassets */; }; 20 | 18E5712B1DEDB93F0048F386 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18E571291DEDB93F0048F386 /* LaunchScreen.storyboard */; }; 21 | 18E571381DEDBA5A0048F386 /* LZBTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E571371DEDBA5A0048F386 /* LZBTextView.m */; }; 22 | 18E571401DEDD1720048F386 /* LZBUserTextViewVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E5713F1DEDD1720048F386 /* LZBUserTextViewVC.m */; }; 23 | 18F07ECA1DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07EC91DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.m */; }; 24 | 18F07ECE1DF65191009D5069 /* NSString+LZBTranscoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07ECD1DF65191009D5069 /* NSString+LZBTranscoding.m */; }; 25 | 18F07ED11DF656C9009D5069 /* LZBEmojiModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07ED01DF656C9009D5069 /* LZBEmojiModel.m */; }; 26 | 18F07ED41DF6577F009D5069 /* LZBEmojiButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07ED31DF6577F009D5069 /* LZBEmojiButton.m */; }; 27 | 18F07ED71DF658A9009D5069 /* LZBFaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07ED61DF658A9009D5069 /* LZBFaceView.m */; }; 28 | 18F07EE31DF65959009D5069 /* Resource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 18F07EE21DF65959009D5069 /* Resource.bundle */; }; 29 | 18F07EE61DF660B0009D5069 /* LZBFaceSignlePageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07EE51DF660B0009D5069 /* LZBFaceSignlePageView.m */; }; 30 | 18F07EE91DF699BE009D5069 /* LZBEmojiKeyBoardVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F07EE81DF699BE009D5069 /* LZBEmojiKeyBoardVC.m */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 18A667B21DF40F6A00BC6664 /* LZBKeyBoardToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBKeyBoardToolBar.h; sourceTree = ""; }; 35 | 18A667B31DF40F6A00BC6664 /* LZBKeyBoardToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBKeyBoardToolBar.m; sourceTree = ""; }; 36 | 18A667B51DF415DE00BC6664 /* UIView+LZBViewFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+LZBViewFrame.h"; sourceTree = ""; }; 37 | 18A667B61DF415DE00BC6664 /* UIView+LZBViewFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+LZBViewFrame.m"; sourceTree = ""; }; 38 | 18A667C41DF445C900BC6664 /* LZBKeyBoardToolVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBKeyBoardToolVC.h; sourceTree = ""; }; 39 | 18A667C51DF445C900BC6664 /* LZBKeyBoardToolVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBKeyBoardToolVC.m; sourceTree = ""; }; 40 | 18D81EC61DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+LZBKeyBoardObserver.h"; sourceTree = ""; }; 41 | 18D81EC71DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+LZBKeyBoardObserver.m"; sourceTree = ""; }; 42 | 18D81EC91DEEF7A8007456A0 /* LZBAutoAdjustViewVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBAutoAdjustViewVC.h; sourceTree = ""; }; 43 | 18D81ECA1DEEF7A8007456A0 /* LZBAutoAdjustViewVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBAutoAdjustViewVC.m; sourceTree = ""; }; 44 | 18E571181DEDB93F0048F386 /* LZBKeyBoardView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LZBKeyBoardView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 18E5711C1DEDB93F0048F386 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 18E5711E1DEDB93F0048F386 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | 18E5711F1DEDB93F0048F386 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | 18E571211DEDB93F0048F386 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 49 | 18E571221DEDB93F0048F386 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 50 | 18E571251DEDB93F0048F386 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 18E571271DEDB93F0048F386 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 18E5712A1DEDB93F0048F386 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 18E5712C1DEDB93F0048F386 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 18E571361DEDBA5A0048F386 /* LZBTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBTextView.h; sourceTree = ""; }; 55 | 18E571371DEDBA5A0048F386 /* LZBTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBTextView.m; sourceTree = ""; }; 56 | 18E5713E1DEDD1720048F386 /* LZBUserTextViewVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBUserTextViewVC.h; sourceTree = ""; }; 57 | 18E5713F1DEDD1720048F386 /* LZBUserTextViewVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBUserTextViewVC.m; sourceTree = ""; }; 58 | 18F07EC81DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBKeyBoardToolEmojiBar.h; sourceTree = ""; }; 59 | 18F07EC91DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBKeyBoardToolEmojiBar.m; sourceTree = ""; }; 60 | 18F07ECC1DF65191009D5069 /* NSString+LZBTranscoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+LZBTranscoding.h"; sourceTree = ""; }; 61 | 18F07ECD1DF65191009D5069 /* NSString+LZBTranscoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+LZBTranscoding.m"; sourceTree = ""; }; 62 | 18F07ECF1DF656C9009D5069 /* LZBEmojiModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBEmojiModel.h; sourceTree = ""; }; 63 | 18F07ED01DF656C9009D5069 /* LZBEmojiModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBEmojiModel.m; sourceTree = ""; }; 64 | 18F07ED21DF6577F009D5069 /* LZBEmojiButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBEmojiButton.h; sourceTree = ""; }; 65 | 18F07ED31DF6577F009D5069 /* LZBEmojiButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBEmojiButton.m; sourceTree = ""; }; 66 | 18F07ED51DF658A9009D5069 /* LZBFaceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBFaceView.h; sourceTree = ""; }; 67 | 18F07ED61DF658A9009D5069 /* LZBFaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBFaceView.m; sourceTree = ""; }; 68 | 18F07EE21DF65959009D5069 /* Resource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Resource.bundle; sourceTree = ""; }; 69 | 18F07EE41DF660B0009D5069 /* LZBFaceSignlePageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBFaceSignlePageView.h; sourceTree = ""; }; 70 | 18F07EE51DF660B0009D5069 /* LZBFaceSignlePageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBFaceSignlePageView.m; sourceTree = ""; }; 71 | 18F07EE71DF699BE009D5069 /* LZBEmojiKeyBoardVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LZBEmojiKeyBoardVC.h; sourceTree = ""; }; 72 | 18F07EE81DF699BE009D5069 /* LZBEmojiKeyBoardVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LZBEmojiKeyBoardVC.m; sourceTree = ""; }; 73 | /* End PBXFileReference section */ 74 | 75 | /* Begin PBXFrameworksBuildPhase section */ 76 | 18E571151DEDB93F0048F386 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 18E5710F1DEDB93F0048F386 = { 87 | isa = PBXGroup; 88 | children = ( 89 | 18E5711A1DEDB93F0048F386 /* LZBKeyBoardView */, 90 | 18E571191DEDB93F0048F386 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 18E571191DEDB93F0048F386 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 18E571181DEDB93F0048F386 /* LZBKeyBoardView.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 18E5711A1DEDB93F0048F386 /* LZBKeyBoardView */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 18E571351DEDBA5A0048F386 /* LZBKeyBoardView */, 106 | 18E5711E1DEDB93F0048F386 /* AppDelegate.h */, 107 | 18E5711F1DEDB93F0048F386 /* AppDelegate.m */, 108 | 18E571211DEDB93F0048F386 /* ViewController.h */, 109 | 18E571221DEDB93F0048F386 /* ViewController.m */, 110 | 18E571241DEDB93F0048F386 /* Main.storyboard */, 111 | 18E571271DEDB93F0048F386 /* Assets.xcassets */, 112 | 18E571291DEDB93F0048F386 /* LaunchScreen.storyboard */, 113 | 18E5712C1DEDB93F0048F386 /* Info.plist */, 114 | 18E5713E1DEDD1720048F386 /* LZBUserTextViewVC.h */, 115 | 18E5713F1DEDD1720048F386 /* LZBUserTextViewVC.m */, 116 | 18D81EC91DEEF7A8007456A0 /* LZBAutoAdjustViewVC.h */, 117 | 18D81ECA1DEEF7A8007456A0 /* LZBAutoAdjustViewVC.m */, 118 | 18A667C41DF445C900BC6664 /* LZBKeyBoardToolVC.h */, 119 | 18A667C51DF445C900BC6664 /* LZBKeyBoardToolVC.m */, 120 | 18F07EE71DF699BE009D5069 /* LZBEmojiKeyBoardVC.h */, 121 | 18F07EE81DF699BE009D5069 /* LZBEmojiKeyBoardVC.m */, 122 | 18E5711B1DEDB93F0048F386 /* Supporting Files */, 123 | ); 124 | path = LZBKeyBoardView; 125 | sourceTree = ""; 126 | }; 127 | 18E5711B1DEDB93F0048F386 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 18E5711C1DEDB93F0048F386 /* main.m */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | 18E571351DEDBA5A0048F386 /* LZBKeyBoardView */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 18F07EE21DF65959009D5069 /* Resource.bundle */, 139 | 18F07ECB1DF64E8D009D5069 /* FaceView */, 140 | 18E571361DEDBA5A0048F386 /* LZBTextView.h */, 141 | 18E571371DEDBA5A0048F386 /* LZBTextView.m */, 142 | 18A667B21DF40F6A00BC6664 /* LZBKeyBoardToolBar.h */, 143 | 18A667B31DF40F6A00BC6664 /* LZBKeyBoardToolBar.m */, 144 | 18F07EC81DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.h */, 145 | 18F07EC91DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.m */, 146 | 18F07ECC1DF65191009D5069 /* NSString+LZBTranscoding.h */, 147 | 18F07ECD1DF65191009D5069 /* NSString+LZBTranscoding.m */, 148 | 18D81EC61DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.h */, 149 | 18D81EC71DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.m */, 150 | 18A667B51DF415DE00BC6664 /* UIView+LZBViewFrame.h */, 151 | 18A667B61DF415DE00BC6664 /* UIView+LZBViewFrame.m */, 152 | ); 153 | path = LZBKeyBoardView; 154 | sourceTree = ""; 155 | }; 156 | 18F07ECB1DF64E8D009D5069 /* FaceView */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 18F07ECF1DF656C9009D5069 /* LZBEmojiModel.h */, 160 | 18F07ED01DF656C9009D5069 /* LZBEmojiModel.m */, 161 | 18F07ED21DF6577F009D5069 /* LZBEmojiButton.h */, 162 | 18F07ED31DF6577F009D5069 /* LZBEmojiButton.m */, 163 | 18F07ED51DF658A9009D5069 /* LZBFaceView.h */, 164 | 18F07ED61DF658A9009D5069 /* LZBFaceView.m */, 165 | 18F07EE41DF660B0009D5069 /* LZBFaceSignlePageView.h */, 166 | 18F07EE51DF660B0009D5069 /* LZBFaceSignlePageView.m */, 167 | ); 168 | path = FaceView; 169 | sourceTree = ""; 170 | }; 171 | /* End PBXGroup section */ 172 | 173 | /* Begin PBXNativeTarget section */ 174 | 18E571171DEDB93F0048F386 /* LZBKeyBoardView */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 18E5712F1DEDB93F0048F386 /* Build configuration list for PBXNativeTarget "LZBKeyBoardView" */; 177 | buildPhases = ( 178 | 18E571141DEDB93F0048F386 /* Sources */, 179 | 18E571151DEDB93F0048F386 /* Frameworks */, 180 | 18E571161DEDB93F0048F386 /* Resources */, 181 | ); 182 | buildRules = ( 183 | ); 184 | dependencies = ( 185 | ); 186 | name = LZBKeyBoardView; 187 | productName = LZBKeyBoardView; 188 | productReference = 18E571181DEDB93F0048F386 /* LZBKeyBoardView.app */; 189 | productType = "com.apple.product-type.application"; 190 | }; 191 | /* End PBXNativeTarget section */ 192 | 193 | /* Begin PBXProject section */ 194 | 18E571101DEDB93F0048F386 /* Project object */ = { 195 | isa = PBXProject; 196 | attributes = { 197 | LastUpgradeCheck = 0810; 198 | ORGANIZATIONNAME = apple; 199 | TargetAttributes = { 200 | 18E571171DEDB93F0048F386 = { 201 | CreatedOnToolsVersion = 8.1; 202 | DevelopmentTeam = 8LYGY3ZDDQ; 203 | ProvisioningStyle = Automatic; 204 | }; 205 | }; 206 | }; 207 | buildConfigurationList = 18E571131DEDB93F0048F386 /* Build configuration list for PBXProject "LZBKeyBoardView" */; 208 | compatibilityVersion = "Xcode 3.2"; 209 | developmentRegion = English; 210 | hasScannedForEncodings = 0; 211 | knownRegions = ( 212 | en, 213 | Base, 214 | ); 215 | mainGroup = 18E5710F1DEDB93F0048F386; 216 | productRefGroup = 18E571191DEDB93F0048F386 /* Products */; 217 | projectDirPath = ""; 218 | projectRoot = ""; 219 | targets = ( 220 | 18E571171DEDB93F0048F386 /* LZBKeyBoardView */, 221 | ); 222 | }; 223 | /* End PBXProject section */ 224 | 225 | /* Begin PBXResourcesBuildPhase section */ 226 | 18E571161DEDB93F0048F386 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | 18E5712B1DEDB93F0048F386 /* LaunchScreen.storyboard in Resources */, 231 | 18E571281DEDB93F0048F386 /* Assets.xcassets in Resources */, 232 | 18F07EE31DF65959009D5069 /* Resource.bundle in Resources */, 233 | 18E571261DEDB93F0048F386 /* Main.storyboard in Resources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXResourcesBuildPhase section */ 238 | 239 | /* Begin PBXSourcesBuildPhase section */ 240 | 18E571141DEDB93F0048F386 /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | 18A667C61DF445C900BC6664 /* LZBKeyBoardToolVC.m in Sources */, 245 | 18F07ED41DF6577F009D5069 /* LZBEmojiButton.m in Sources */, 246 | 18F07ED11DF656C9009D5069 /* LZBEmojiModel.m in Sources */, 247 | 18F07EE61DF660B0009D5069 /* LZBFaceSignlePageView.m in Sources */, 248 | 18F07ECA1DF64D4D009D5069 /* LZBKeyBoardToolEmojiBar.m in Sources */, 249 | 18D81EC81DEEF4D5007456A0 /* UIViewController+LZBKeyBoardObserver.m in Sources */, 250 | 18F07EE91DF699BE009D5069 /* LZBEmojiKeyBoardVC.m in Sources */, 251 | 18F07ED71DF658A9009D5069 /* LZBFaceView.m in Sources */, 252 | 18E571401DEDD1720048F386 /* LZBUserTextViewVC.m in Sources */, 253 | 18E571381DEDBA5A0048F386 /* LZBTextView.m in Sources */, 254 | 18A667B41DF40F6A00BC6664 /* LZBKeyBoardToolBar.m in Sources */, 255 | 18E571231DEDB93F0048F386 /* ViewController.m in Sources */, 256 | 18F07ECE1DF65191009D5069 /* NSString+LZBTranscoding.m in Sources */, 257 | 18E571201DEDB93F0048F386 /* AppDelegate.m in Sources */, 258 | 18A667B71DF415DE00BC6664 /* UIView+LZBViewFrame.m in Sources */, 259 | 18D81ECB1DEEF7A8007456A0 /* LZBAutoAdjustViewVC.m in Sources */, 260 | 18E5711D1DEDB93F0048F386 /* main.m in Sources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | /* End PBXSourcesBuildPhase section */ 265 | 266 | /* Begin PBXVariantGroup section */ 267 | 18E571241DEDB93F0048F386 /* Main.storyboard */ = { 268 | isa = PBXVariantGroup; 269 | children = ( 270 | 18E571251DEDB93F0048F386 /* Base */, 271 | ); 272 | name = Main.storyboard; 273 | sourceTree = ""; 274 | }; 275 | 18E571291DEDB93F0048F386 /* LaunchScreen.storyboard */ = { 276 | isa = PBXVariantGroup; 277 | children = ( 278 | 18E5712A1DEDB93F0048F386 /* Base */, 279 | ); 280 | name = LaunchScreen.storyboard; 281 | sourceTree = ""; 282 | }; 283 | /* End PBXVariantGroup section */ 284 | 285 | /* Begin XCBuildConfiguration section */ 286 | 18E5712D1DEDB93F0048F386 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_ANALYZER_NONNULL = YES; 291 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 292 | CLANG_CXX_LIBRARY = "libc++"; 293 | CLANG_ENABLE_MODULES = YES; 294 | CLANG_ENABLE_OBJC_ARC = YES; 295 | CLANG_WARN_BOOL_CONVERSION = YES; 296 | CLANG_WARN_CONSTANT_CONVERSION = YES; 297 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 298 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INFINITE_RECURSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 304 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 305 | CLANG_WARN_UNREACHABLE_CODE = YES; 306 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 307 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 308 | COPY_PHASE_STRIP = NO; 309 | DEBUG_INFORMATION_FORMAT = dwarf; 310 | ENABLE_STRICT_OBJC_MSGSEND = YES; 311 | ENABLE_TESTABILITY = YES; 312 | GCC_C_LANGUAGE_STANDARD = gnu99; 313 | GCC_DYNAMIC_NO_PIC = NO; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_OPTIMIZATION_LEVEL = 0; 316 | GCC_PREPROCESSOR_DEFINITIONS = ( 317 | "DEBUG=1", 318 | "$(inherited)", 319 | ); 320 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 321 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 322 | GCC_WARN_UNDECLARED_SELECTOR = YES; 323 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 324 | GCC_WARN_UNUSED_FUNCTION = YES; 325 | GCC_WARN_UNUSED_VARIABLE = YES; 326 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 327 | MTL_ENABLE_DEBUG_INFO = YES; 328 | ONLY_ACTIVE_ARCH = YES; 329 | SDKROOT = iphoneos; 330 | }; 331 | name = Debug; 332 | }; 333 | 18E5712E1DEDB93F0048F386 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 351 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 357 | ENABLE_NS_ASSERTIONS = NO; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 368 | MTL_ENABLE_DEBUG_INFO = NO; 369 | SDKROOT = iphoneos; 370 | VALIDATE_PRODUCT = YES; 371 | }; 372 | name = Release; 373 | }; 374 | 18E571301DEDB93F0048F386 /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | DEVELOPMENT_TEAM = 8LYGY3ZDDQ; 379 | INFOPLIST_FILE = LZBKeyBoardView/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 381 | PRODUCT_BUNDLE_IDENTIFIER = "-23334.LZBKeyBoardView"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | }; 384 | name = Debug; 385 | }; 386 | 18E571311DEDB93F0048F386 /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 390 | DEVELOPMENT_TEAM = 8LYGY3ZDDQ; 391 | INFOPLIST_FILE = LZBKeyBoardView/Info.plist; 392 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 393 | PRODUCT_BUNDLE_IDENTIFIER = "-23334.LZBKeyBoardView"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | }; 396 | name = Release; 397 | }; 398 | /* End XCBuildConfiguration section */ 399 | 400 | /* Begin XCConfigurationList section */ 401 | 18E571131DEDB93F0048F386 /* Build configuration list for PBXProject "LZBKeyBoardView" */ = { 402 | isa = XCConfigurationList; 403 | buildConfigurations = ( 404 | 18E5712D1DEDB93F0048F386 /* Debug */, 405 | 18E5712E1DEDB93F0048F386 /* Release */, 406 | ); 407 | defaultConfigurationIsVisible = 0; 408 | defaultConfigurationName = Release; 409 | }; 410 | 18E5712F1DEDB93F0048F386 /* Build configuration list for PBXNativeTarget "LZBKeyBoardView" */ = { 411 | isa = XCConfigurationList; 412 | buildConfigurations = ( 413 | 18E571301DEDB93F0048F386 /* Debug */, 414 | 18E571311DEDB93F0048F386 /* Release */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | /* End XCConfigurationList section */ 420 | }; 421 | rootObject = 18E571101DEDB93F0048F386 /* Project object */; 422 | } 423 | --------------------------------------------------------------------------------