TabControl.h 1001 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // TabControl.h
  3. // model
  4. //
  5. // Created by Drew on 2018/11/1.
  6. // Copyright © 2018年 Mine. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. IB_DESIGNABLE
  11. @protocol TabControlDelegate <NSObject>
  12. - (void) tabChange:(NSInteger) index;
  13. @end
  14. typedef NS_ENUM(NSInteger, TabControlState) {
  15. TabControlStateNormal,
  16. TabControlStateActive
  17. };
  18. @interface TabControl : UIView
  19. @property (nonatomic, assign) NSInteger index;
  20. @property (nonatomic, retain) id<TabControlDelegate> delegate;
  21. @property (nonatomic, strong) IBInspectable UIColor* backgroungColor;
  22. @property (nonatomic, strong) IBInspectable UIColor* indicatorColor;
  23. @property (nonatomic, strong) IBInspectable UIColor* normalColor;
  24. @property (nonatomic, strong) IBInspectable UIColor* activeColor;
  25. @property (nonatomic, strong) IBInspectable NSString* tab1;
  26. @property (nonatomic, strong) IBInspectable NSString* tab2;
  27. - (void)setColor:(UIColor*) color forState:(TabControlState) state;
  28. @end
  29. NS_ASSUME_NONNULL_END