UIPlaceHolderTextView.h 746 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // UIPlaceHolderTextView.h
  3. // iLunch
  4. //
  5. // Created by AlexiChen on 15-1-11.
  6. // Copyright (c) 2015年 AlexiChen Chen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIPlaceHolderTextView : UITextView
  10. @property (nonatomic, strong) NSString *placeHolder;
  11. @property (nonatomic, strong) UIColor *placeHolderColor;
  12. @property (nonatomic, strong) UIColor *mainTextColor;
  13. @end
  14. @interface UILimitTextView : UIPlaceHolderTextView
  15. {
  16. @protected
  17. UILabel *_limitText;
  18. }
  19. @property (nonatomic, readonly) UILabel *limitText; // 设置limitLength>0后有效
  20. @property (nonatomic, assign) NSInteger limitLength;
  21. - (BOOL)shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
  22. - (void)updateLimitText;
  23. @end