EaseTextView.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import <UIKit/UIKit.h>
  13. typedef NS_ENUM(NSUInteger, DXTextViewInputViewType) {
  14. DXTextViewNormalInputType = 0,
  15. DXTextViewTextInputType,
  16. DXTextViewFaceInputType,
  17. DXTextViewShareMenuInputType,
  18. };
  19. @interface EaseTextView : UITextView
  20. /*
  21. * 提示用户输入的标语
  22. */
  23. @property (nonatomic, copy) NSString *placeHolder;
  24. /*
  25. * 标语文本的颜色
  26. */
  27. @property (nonatomic, strong) UIColor *placeHolderTextColor;
  28. /*
  29. @method
  30. @brief 获取自身文本占据有多少行
  31. @discussion
  32. @result 返回行数
  33. */
  34. - (NSUInteger)numberOfLinesOfText;
  35. /*
  36. @method
  37. @brief 获取每行的高度
  38. @discussion
  39. @result 根据iPhone或者iPad来获取每行字体的高度
  40. */
  41. + (NSUInteger)maxCharactersPerLine;
  42. /*
  43. @method
  44. @brief 获取某个文本占据自身适应宽带的行数
  45. @discussion
  46. @param text 目标文本
  47. @result 返回占据行数
  48. */
  49. + (NSUInteger)numberOfLinesForMessage:(NSString *)text;
  50. @end