// // YOUPAITFBaseCollectionCell.m // trueface // // Created by Apple on 2019/10/10. // Copyright © 2019 jie. All rights reserved. // #import "YOUPAITFBaseCollectionCell.h" @interface YOUPAITFBaseCollectionCell() @end @implementation YOUPAITFBaseCollectionCell +(instancetype)youpaifcellWithCollectionViewCell:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath { NSString *className = NSStringFromClass([self class]); id rigistedClass = objc_getAssociatedObject(self, (__bridge const void * _Nonnull)(className)); if (!rigistedClass) { [collectionView registerClass:[self class] forCellWithReuseIdentifier:className]; rigistedClass = NSStringFromClass([self class]); objc_setAssociatedObject(self, (__bridge const void * _Nonnull)(className), rigistedClass, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:className forIndexPath:indexPath]; return (YOUPAITFBaseCollectionCell *)cell; } -(instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self youpaifsetupUI]; } return self; } -(void)youpaifsetupUI { } @end