Commit 04531cdaa17e12614d283ce8997ce266039a5c00
1 parent
9b98c3f1
no message
Showing
4 changed files
with
28 additions
and
30 deletions
CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCollectionViewCell.h renamed to CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCell.h
| 1 | 1 | // |
| 2 | -// CNLiveNotSeeCollectionViewCell.h | |
| 2 | +// CNLiveNotSeeCell.h | |
| 3 | 3 | // CNLiveSettingModule |
| 4 | 4 | // |
| 5 | 5 | // Created by CNLive-zxw on 2019/4/22. |
| ... | ... | @@ -9,18 +9,18 @@ |
| 9 | 9 | #import <UIKit/UIKit.h> |
| 10 | 10 | |
| 11 | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | -#define kCNLiveNotSeeCollectionViewCell @"CNLiveNotSeeCollectionViewCell" | |
| 12 | +#define kCNLiveNotSeeCell @"CNLiveNotSeeCell" | |
| 13 | 13 | @class CNLiveNotSeeModel; |
| 14 | -@class CNLiveNotSeeCollectionViewCell; | |
| 14 | +@class CNLiveNotSeeCell; | |
| 15 | 15 | |
| 16 | -@protocol CNLiveNotSeeCollectionViewCellDelegate <NSObject> | |
| 17 | -- (void)clickedDelButton:(CNLiveNotSeeCollectionViewCell *)cell; | |
| 18 | -- (void)longPressCell:(CNLiveNotSeeCollectionViewCell *)cell; | |
| 16 | +@protocol CNLiveNotSeeCellDelegate <NSObject> | |
| 17 | +- (void)clickedDel:(CNLiveNotSeeCell *)cell; | |
| 18 | +- (void)longPressCell:(CNLiveNotSeeCell *)cell; | |
| 19 | 19 | |
| 20 | 20 | @end |
| 21 | -@interface CNLiveNotSeeCollectionViewCell : UICollectionViewCell | |
| 21 | +@interface CNLiveNotSeeCell : UICollectionViewCell | |
| 22 | 22 | @property (nonatomic, strong) CNLiveNotSeeModel *model; |
| 23 | -@property (nonatomic, weak) id<CNLiveNotSeeCollectionViewCellDelegate> delegate; | |
| 23 | +@property (nonatomic, weak) id<CNLiveNotSeeCellDelegate> delegate; | |
| 24 | 24 | |
| 25 | 25 | @end |
| 26 | 26 | ... | ... |
CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCollectionViewCell.m renamed to CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeCell.m
| 1 | 1 | // |
| 2 | -// CNLiveNotSeeCollectionViewCell.m | |
| 2 | +// CNLiveNotSeeCell.m | |
| 3 | 3 | // CNLiveSettingModule |
| 4 | 4 | // |
| 5 | 5 | // Created by CNLive-zxw on 2019/4/22. |
| 6 | 6 | // Copyright © 2019 cnlive. All rights reserved. |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | -#import "CNLiveNotSeeCollectionViewCell.h" | |
| 9 | +#import "CNLiveNotSeeCell.h" | |
| 10 | 10 | #import <SDWebImage/SDWebImage.h> |
| 11 | 11 | #import "QMUIKit.h" |
| 12 | 12 | #import <Masonry/Masonry.h> |
| ... | ... | @@ -14,14 +14,14 @@ |
| 14 | 14 | |
| 15 | 15 | #import "CNLiveNotSeeModel.h" |
| 16 | 16 | |
| 17 | -@interface CNLiveNotSeeCollectionViewCell() | |
| 17 | +@interface CNLiveNotSeeCell() | |
| 18 | 18 | @property (nonatomic, strong) UIButton *delButton; |
| 19 | 19 | @property (nonatomic, strong) UIImageView *avatarImage; |
| 20 | 20 | @property (nonatomic, strong) UILabel *nameLabel; |
| 21 | 21 | |
| 22 | 22 | @end |
| 23 | 23 | |
| 24 | -@implementation CNLiveNotSeeCollectionViewCell | |
| 24 | +@implementation CNLiveNotSeeCell | |
| 25 | 25 | - (instancetype)initWithFrame:(CGRect)frame { |
| 26 | 26 | self = [super initWithFrame:frame]; |
| 27 | 27 | if (self) { |
| ... | ... | @@ -38,14 +38,14 @@ |
| 38 | 38 | if(model.type == CNLiveNotSeeModelTypeAdd){ |
| 39 | 39 | _avatarImage.layer.masksToBounds = NO; |
| 40 | 40 | _avatarImage.layer.cornerRadius = 0; |
| 41 | - UIImage *xw_image = [self getImageWithImageName:@"privacy_plus" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]]; | |
| 41 | + UIImage *xw_image = [self getImageWithImageName:@"privacy_plus" bundleName:@"CNLiveSettingModule" targetClass:[self class]]; | |
| 42 | 42 | [_avatarImage sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:xw_image]; |
| 43 | 43 | _nameLabel.text = @""; |
| 44 | 44 | |
| 45 | 45 | }else if (model.type == CNLiveNotSeeModelTypeMinus){ |
| 46 | 46 | _avatarImage.layer.masksToBounds = NO; |
| 47 | 47 | _avatarImage.layer.cornerRadius = 0; |
| 48 | - UIImage *xw_image = [self getImageWithImageName:@"privacy_less" bundleName:@"CNLiveSettingModule" targetClass:[CNLiveNotSeeCollectionViewCell class]]; | |
| 48 | + UIImage *xw_image = [self getImageWithImageName:@"privacy_less" bundleName:@"CNLiveSettingModule" targetClass:[self class]]; | |
| 49 | 49 | [_avatarImage sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:xw_image]; |
| 50 | 50 | _nameLabel.text = @""; |
| 51 | 51 | |
| ... | ... | @@ -128,8 +128,8 @@ |
| 128 | 128 | |
| 129 | 129 | #pragma mark - Action Methods |
| 130 | 130 | - (void)delButtonDidClicked:(UIButton *)btn{ |
| 131 | - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedDelButton:)]) { | |
| 132 | - [self.delegate clickedDelButton:self]; | |
| 131 | + if (self.delegate && [self.delegate respondsToSelector:@selector(clickedDel:)]) { | |
| 132 | + [self.delegate clickedDel:self]; | |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| ... | ... | @@ -138,9 +138,7 @@ |
| 138 | 138 | if(_model.type == CNLiveNotSeeModelTypeAdd||_model.type == CNLiveNotSeeModelTypeMinus){ |
| 139 | 139 | return; |
| 140 | 140 | } |
| 141 | - //进行判断,在什么时候触发事件 | |
| 142 | 141 | if (sender.state == UIGestureRecognizerStateBegan) { |
| 143 | - NSLog(@"长按状态"); | |
| 144 | 142 | if (self.delegate && [self.delegate respondsToSelector:@selector(longPressCell:)]) { |
| 145 | 143 | [self.delegate longPressCell:self]; |
| 146 | 144 | } | ... | ... |
CNLiveSettingModule/Classes/Privacy/CNLiveNotSeeController.m
| ... | ... | @@ -18,11 +18,11 @@ |
| 18 | 18 | #import "CNLiveBaseKit.h" |
| 19 | 19 | |
| 20 | 20 | #import "CNLiveNavigationBar.h" |
| 21 | -#import "CNLiveNotSeeCollectionViewCell.h" | |
| 21 | +#import "CNLiveNotSeeCell.h" | |
| 22 | 22 | #import "CNLiveNotSeeModel.h" |
| 23 | 23 | |
| 24 | 24 | |
| 25 | -@interface CNLiveNotSeeController ()<UICollectionViewDelegate, UICollectionViewDataSource, CNLiveNotSeeCollectionViewCellDelegate>{ | |
| 25 | +@interface CNLiveNotSeeController ()<UICollectionViewDelegate, UICollectionViewDataSource, CNLiveNotSeeCellDelegate>{ | |
| 26 | 26 | BOOL _isEdit; |
| 27 | 27 | } |
| 28 | 28 | |
| ... | ... | @@ -122,17 +122,13 @@ static const NSInteger SectionHeight = 50; |
| 122 | 122 | |
| 123 | 123 | }]; |
| 124 | 124 | } |
| 125 | -#pragma mark - CollectionView Delegate | |
| 126 | -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ | |
| 127 | - return 1; | |
| 128 | - | |
| 129 | -} | |
| 125 | +#pragma mark - UICollectionViewDelegate | |
| 130 | 126 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ |
| 131 | 127 | return self.afterData.count; |
| 132 | 128 | |
| 133 | 129 | } |
| 134 | 130 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ |
| 135 | - CNLiveNotSeeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCNLiveNotSeeCollectionViewCell forIndexPath:indexPath]; | |
| 131 | + CNLiveNotSeeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCNLiveNotSeeCell forIndexPath:indexPath]; | |
| 136 | 132 | cell.model = self.afterData[indexPath.row]; |
| 137 | 133 | cell.delegate = self; |
| 138 | 134 | return cell; |
| ... | ... | @@ -205,13 +201,13 @@ static const NSInteger SectionHeight = 50; |
| 205 | 201 | } |
| 206 | 202 | |
| 207 | 203 | } |
| 208 | -#pragma mark - CNLiveNotSeeCollectionViewCellDelegate | |
| 209 | -- (void)longPressCell:(CNLiveNotSeeCollectionViewCell *)cell{ | |
| 204 | +#pragma mark - CNLiveNotSeeCellDelegate | |
| 205 | +- (void)longPressCell:(CNLiveNotSeeCell *)cell{ | |
| 210 | 206 | [self changeEditState]; |
| 211 | 207 | |
| 212 | 208 | } |
| 213 | 209 | |
| 214 | -- (void)clickedDelButton:(CNLiveNotSeeCollectionViewCell *)cell{ | |
| 210 | +- (void)clickedDel:(CNLiveNotSeeCell *)cell{ | |
| 215 | 211 | if([self.afterData containsObject:cell.model]){ |
| 216 | 212 | [self.afterData removeObject:cell.model]; |
| 217 | 213 | |
| ... | ... | @@ -500,7 +496,7 @@ static const NSInteger SectionHeight = 50; |
| 500 | 496 | |
| 501 | 497 | _collectionView.showsVerticalScrollIndicator = NO; |
| 502 | 498 | _collectionView.showsHorizontalScrollIndicator = NO; |
| 503 | - [_collectionView registerClass:[CNLiveNotSeeCollectionViewCell class] forCellWithReuseIdentifier:kCNLiveNotSeeCollectionViewCell]; | |
| 499 | + [_collectionView registerClass:[CNLiveNotSeeCell class] forCellWithReuseIdentifier:kCNLiveNotSeeCell]; | |
| 504 | 500 | [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionElementKindSectionHeader"]; |
| 505 | 501 | flowLayout.headerReferenceSize = CGSizeMake(SCREEN_WIDTH, 0.0000001); |
| 506 | 502 | ... | ... |
Example/CNLiveSettingModule.xcodeproj/project.pbxproj
| ... | ... | @@ -352,6 +352,7 @@ |
| 352 | 352 | "${PODS_ROOT}/Target Support Files/Pods-CNLiveSettingModule_Example/Pods-CNLiveSettingModule_Example-frameworks.sh", |
| 353 | 353 | "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", |
| 354 | 354 | "${BUILT_PRODUCTS_DIR}/CNLiveAVCamera/CNLiveAVCamera.framework", |
| 355 | + "${BUILT_PRODUCTS_DIR}/CNLiveBaseClass/CNLiveBaseClass.framework", | |
| 355 | 356 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", |
| 356 | 357 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework", |
| 357 | 358 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| ... | ... | @@ -376,12 +377,14 @@ |
| 376 | 377 | "${BUILT_PRODUCTS_DIR}/Qiniu/Qiniu.framework", |
| 377 | 378 | "${BUILT_PRODUCTS_DIR}/SDAutoLayout/SDAutoLayout.framework", |
| 378 | 379 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", |
| 380 | + "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework", | |
| 379 | 381 | "${BUILT_PRODUCTS_DIR}/YYKit/YYKit.framework", |
| 380 | 382 | ); |
| 381 | 383 | name = "[CP] Embed Pods Frameworks"; |
| 382 | 384 | outputPaths = ( |
| 383 | 385 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", |
| 384 | 386 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveAVCamera.framework", |
| 387 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseClass.framework", | |
| 385 | 388 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", |
| 386 | 389 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework", |
| 387 | 390 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| ... | ... | @@ -406,6 +409,7 @@ |
| 406 | 409 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Qiniu.framework", |
| 407 | 410 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDAutoLayout.framework", |
| 408 | 411 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", |
| 412 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework", | |
| 409 | 413 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKit.framework", |
| 410 | 414 | ); |
| 411 | 415 | runOnlyForDeploymentPostprocessing = 0; | ... | ... |