CGXVerticalMenuIndicatoCollectionView.m 992 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // CGXHomeCategoryCollectionView.m
  3. // CGXVerticalMenuView-OC
  4. //
  5. // Created by CGX on 2018/05/01.
  6. // Copyright © 2019 CGX. All rights reserved.
  7. //
  8. #import "CGXVerticalMenuIndicatoCollectionView.h"
  9. @implementation CGXVerticalMenuIndicatoCollectionView
  10. - (void)setIndicators:(NSArray<UIView<CGXCategoryListIndicatorProtocol> *> *)indicators {
  11. for (UIView *indicator in _indicators) {
  12. //先移除之前的indicator
  13. [indicator removeFromSuperview];
  14. }
  15. _indicators = indicators;
  16. for (UIView *indicator in indicators) {
  17. [self addSubview:indicator];
  18. }
  19. }
  20. - (void)layoutSubviews
  21. {
  22. [super layoutSubviews];
  23. for (UIView<CGXCategoryListIndicatorProtocol> *view in self.indicators) {
  24. [self sendSubviewToBack:view];
  25. }
  26. }
  27. /*
  28. // Only override drawRect: if you perform custom drawing.
  29. // An empty implementation adversely affects performance during animation.
  30. - (void)drawRect:(CGRect)rect {
  31. // Drawing code
  32. }
  33. */
  34. @end