CWStarRateView.h 820 B

123456789101112131415161718192021222324252627
  1. //
  2. // CWStarRateView.h
  3. // StarRateDemo
  4. //
  5. // Created by WANGCHAO on 14/11/4.
  6. // Copyright (c) 2014年 wangchao. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class CWStarRateView;
  10. @protocol CWStarRateViewDelegate <NSObject>
  11. @optional
  12. - (void)starRateView:(CWStarRateView *)starRateView scroePercentDidChange:(CGFloat)newScorePercent;
  13. @end
  14. @interface CWStarRateView : UIView
  15. @property (nonatomic, assign) CGFloat scorePercent;//得分值,范围为0--1,默认为1
  16. @property (nonatomic, assign) BOOL hasAnimation;//是否允许动画,默认为NO
  17. @property (nonatomic, assign) BOOL allowIncompleteStar;//评分时是否允许不是整星,默认为NO
  18. @property (nonatomic, weak) id<CWStarRateViewDelegate>delegate;
  19. - (instancetype)initWithFrame:(CGRect)frame numberOfStars:(NSInteger)numberOfStars;
  20. @end