RQADCell.m 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // RQADCell.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/11/28.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQADCell.h"
  9. @interface RQADCell ()
  10. @property (weak, nonatomic) IBOutlet UIView *adView;
  11. @end
  12. @implementation RQADCell
  13. #pragma mark - PublicMethods
  14. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  15. static NSString *ID = @"RQADCell";
  16. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  17. RQADCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  18. if (!cell) cell = [self rq_viewFromXib];
  19. return cell;
  20. }
  21. - (void)awakeFromNib {
  22. [super awakeFromNib];
  23. self.adView.frame = CGRectMake(16.f, 0, RQ_SCREEN_WIDTH - 32.f, (RQ_SCREEN_WIDTH - 32.f) / (600 / 150.f));
  24. [RQ_AD_MANAGER loadAdWithAdType:RQADType_Banner_IN customView:self.adView controller:RQControllerHelper.currentViewController cycleSecound:RQ_COMMON_MANAGER.JSJP_APP_AD_CYCLE];
  25. }
  26. @end