CustomLabel.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // CustomLabel.h
  3. // JasonDevelop
  4. //
  5. // Created by Jason Lee on 2013. 12. 10..
  6. // Copyright (c) jasondevelop. All rights reserved.
  7. //
  8. @import UIKit;
  9. typedef void(^CustomLabelTouchHandler)(id label);
  10. @interface CustomLabel : UILabel {
  11. }
  12. @property (weak, nonatomic) id value;
  13. @property (strong, nonatomic) CustomLabelTouchHandler touchHandler; // Use copy if not using ARC
  14. @property (strong, nonatomic) IBInspectable NSString *bgImageName;
  15. @property (assign, nonatomic) IBInspectable CGRect rectForCapBackground; //set with interfacebuilder
  16. - (void)setBold:(NSString *)text;
  17. - (void)setFontSize:(NSString *)text fontSize:(CGFloat)fontSize;
  18. - (void)setRedColor:(NSString *)text;
  19. - (void)setBlueColor:(NSString *)text;
  20. - (void)setColor:(UIColor *)color text:(NSString *)text;
  21. - (void)setUnderLine:(NSString *)text;
  22. - (void)setKern:(NSInteger)kern text:(NSString *)text;
  23. - (void)setLineSpacing:(CGFloat)lineSpacing;
  24. - (void)setLink:(NSString *)text;
  25. - (void)addTarget:(id)target action:(SEL)action;
  26. - (void)addTouchEventHandler:(CustomLabelTouchHandler)handler;
  27. - (void)addTouchEventHandlerWithLabel:(CustomLabelTouchHandler)handler;
  28. @end
  29. @interface CustomTopLabel : CustomLabel
  30. @end