Commit 8971f5248f23d5b1f77b6f8b85ae2383fa96fc34

Authored by yanglingyu
1 parent 95dd1d95

移除通用文件0.2.8

CNLiveCMineModule.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveCMineModule' 10 s.name = 'CNLiveCMineModule'
11 - s.version = '0.2.7' 11 + s.version = '0.2.8'
12 s.summary = '网家家C端个人中心' 12 s.summary = '网家家C端个人中心'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveCMineModule/Classes/TZPhotoCell/Tools/CNCutDown.h renamed to CNLiveCMineModule/Classes/TZPhotoCell/CNCutDown.h
CNLiveCMineModule/Classes/TZPhotoCell/Tools/CNCutDown.m renamed to CNLiveCMineModule/Classes/TZPhotoCell/CNCutDown.m
CNLiveCMineModule/Classes/TZPhotoCell/Tools/CNOrderEventHandle.h renamed to CNLiveCMineModule/Classes/TZPhotoCell/CNOrderEventHandle.h
CNLiveCMineModule/Classes/TZPhotoCell/Tools/CNOrderEventHandle.m renamed to CNLiveCMineModule/Classes/TZPhotoCell/CNOrderEventHandle.m
CNLiveCMineModule/Classes/TZPhotoCell/CNPasswordView.h deleted 100644 → 0
1 -//  
2 -// CNPasswordView.h  
3 -// CNLiveNetAdd  
4 -//  
5 -// Created by 流诗语 on 2018/7/5.  
6 -// Copyright © 2018年 cnlive. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -#import "CNTextField.h"  
11 -  
12 -typedef enum {  
13 - CNLiveActivePayInputTypePassword,//支付密码  
14 - CNLiveActivePayInputTypeVerification //验证码  
15 -} CNLiveActivePayInputType;  
16 -  
17 -  
18 -@interface CNPasswordView : UIView<UITextFieldDelegate>  
19 -  
20 -/**  
21 - 初始化界面  
22 -  
23 - @param inputType 输入类型  
24 - @return 返回  
25 - */  
26 -- (instancetype)initWithCNLiveActivePayInputType:(CNLiveActivePayInputType)inputType;  
27 -  
28 -/**  
29 - * 清除密码  
30 - */  
31 -- (void)clearUpPassword;  
32 -  
33 -@property (copy, nonatomic) void(^passwordResultBlock)(NSString * password);  
34 -  
35 -@property (nonatomic, strong) CNTextField *textField;  
36 -  
37 -@end  
CNLiveCMineModule/Classes/TZPhotoCell/CNPasswordView.m deleted 100644 → 0
1 -  
2 -//  
3 -// CNPasswordView.m  
4 -// CNLiveNetAdd  
5 -//  
6 -// Created by 流诗语 on 2018/7/5.  
7 -// Copyright © 2018年 cnlive. All rights reserved.  
8 -//  
9 -  
10 -#import "CNPasswordView.h"  
11 -  
12 -#define kDotSize CGSizeMake (15, 15) //密码点的大小  
13 -#define kDotCount 6 //密码个数  
14 -  
15 -@interface CNPasswordView ()  
16 -  
17 -@property (nonatomic, strong) NSMutableArray *dotArray; //用于存放黑色的点点  
18 -@property (assign, nonatomic) CNLiveActivePayInputType inputType;  
19 -@end  
20 -  
21 -@implementation CNPasswordView  
22 -- (instancetype)initWithCNLiveActivePayInputType:(CNLiveActivePayInputType)inputType  
23 -{  
24 - self = [super init];  
25 - if (self) {  
26 - self.inputType = inputType;  
27 - self.frame = CGRectMake(0, 0, KScreenWidth-60, 40);  
28 - self.layer.borderColor = [[UIColor grayColor] CGColor];  
29 - self.layer.borderWidth = 1;  
30 - self.layer.masksToBounds = YES;  
31 - self.layer.cornerRadius = 5;  
32 - self.backgroundColor = [UIColor whiteColor];  
33 - [self initPwdTextField];  
34 - }  
35 - return self;  
36 -}  
37 -- (void)initPwdTextField  
38 -{  
39 - //每个密码输入框的宽度  
40 - CGFloat width = self.frame.size.width / kDotCount;  
41 -  
42 - //生成分割线  
43 - for (int i = 0; i < kDotCount - 1; i++) {  
44 - UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.textField.frame) + (i + 1) * width, 0, 1, self.frame.size.height)];  
45 - lineView.backgroundColor = [UIColor grayColor];  
46 - [self addSubview:lineView];  
47 - }  
48 -  
49 - self.dotArray = [[NSMutableArray alloc] init];  
50 - if (self.inputType == CNLiveActivePayInputTypePassword) {  
51 - //生成中间的点  
52 - for (int i = 0; i < kDotCount; i++) {  
53 - UIView *dotView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.textField.frame) + (width - kDotCount) / 2 + i * width, CGRectGetMinY(self.textField.frame) + (self.frame.size.height - kDotSize.height) / 2, kDotSize.width, kDotSize.height)];  
54 - dotView.backgroundColor = [UIColor blackColor];  
55 - dotView.layer.cornerRadius = kDotSize.width / 2.0f;  
56 - dotView.clipsToBounds = YES;  
57 - dotView.hidden = YES; //先隐藏  
58 - [self addSubview:dotView];  
59 - //把创建的黑色点加入到数组中  
60 - [self.dotArray addObject:dotView];  
61 - }  
62 - }else{  
63 - for (int i = 0; i < kDotCount; i++) {  
64 - UILabel *dotView = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.textField.frame) + (width - kDotCount) / 2 + i * width, CGRectGetMinY(self.textField.frame) + (self.frame.size.height - kDotSize.height) / 2, kDotSize.width, kDotSize.height)];  
65 - dotView.backgroundColor = [UIColor whiteColor];  
66 - dotView.textColor = kBlackColor;  
67 - dotView.font = [UIFont systemFontOfSize:17];  
68 - dotView.font = [UIFont boldSystemFontOfSize:17];  
69 - dotView.hidden = YES; //先隐藏  
70 - [self addSubview:dotView];  
71 - //把创建的黑色点加入到数组中  
72 - [self.dotArray addObject:dotView];  
73 - }  
74 - }  
75 -}  
76 -  
77 -- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string  
78 -{  
79 - if([string isEqualToString:@"\n"]) {  
80 - //按回车关闭键盘  
81 - [textField resignFirstResponder];  
82 - return NO;  
83 - } else if(string.length == 0) {  
84 - //判断是不是删除键  
85 - return YES;  
86 - }else if(textField.text.length >= kDotCount) {  
87 - //输入的字符个数大于6,则无法继续输入,返回NO表示禁止输入  
88 - NSLog(@"输入的字符个数大于6,忽略输入");  
89 - return NO;  
90 - } else {  
91 - return YES;  
92 - }  
93 -}  
94 -  
95 -/**  
96 - * 清除密码  
97 - */  
98 -- (void)clearUpPassword  
99 -{  
100 - self.textField.text = @"";  
101 - [self textFieldDidChange:self.textField];  
102 -}  
103 --(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event  
104 -{  
105 - [super touchesBegan:touches withEvent:event];  
106 - [self.textField becomeFirstResponder];  
107 -}  
108 -/**  
109 - * 重置显示的点  
110 - */  
111 -- (void)textFieldDidChange:(UITextField *)textField  
112 -{  
113 - for (UIView *dotView in self.dotArray) {  
114 - dotView.hidden = YES;  
115 - }  
116 - for (int i = 0; i < textField.text.length; i++) {  
117 - ((UIView *)[self.dotArray objectAtIndex:i]).hidden = NO;  
118 - if (self.inputType == CNLiveActivePayInputTypeVerification) {  
119 - UILabel * dotLabel = (UILabel *)[self.dotArray objectAtIndex:i];  
120 - dotLabel.text = [textField.text substringWithRange:NSMakeRange(i, 1)];  
121 - }  
122 - }  
123 -// if (textField.text.length == kDotCount) {  
124 - NSLog(@"输入完毕");  
125 - NSLog(@"获取的输入数字====>%@",textField.text);  
126 - if (self.passwordResultBlock) self.passwordResultBlock(textField.text);  
127 -// }  
128 -}  
129 -#pragma mark - init  
130 -  
131 -- (CNTextField *)textField  
132 -{  
133 - if (!_textField) {  
134 - _textField = [[CNTextField alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];  
135 - _textField.backgroundColor = [UIColor whiteColor];  
136 - //输入的文字颜色为白色  
137 - _textField.textColor = [UIColor whiteColor];  
138 - //输入框光标的颜色为白色  
139 - _textField.tintColor = [UIColor whiteColor];  
140 - _textField.delegate = self;  
141 - _textField.secureTextEntry = YES;  
142 - _textField.autocapitalizationType = UITextAutocapitalizationTypeNone;  
143 - _textField.keyboardType = UIKeyboardTypeNumberPad;  
144 - _textField.layer.borderColor = [[UIColor grayColor] CGColor];  
145 - _textField.layer.borderWidth = 1;  
146 - [_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];  
147 - [self addSubview:_textField];  
148 - }  
149 - return _textField;  
150 -}  
151 -  
152 -@end  
CNLiveCMineModule/Classes/TZPhotoCell/LxGridViewFlowLayout.h deleted 100755 → 0
1 -//  
2 -// LxGridViewFlowLayout.h  
3 -// LxGridView  
4 -//  
5 -  
6 -#import <UIKit/UIKit.h>  
7 -  
8 -/*  
9 - 此类来源于DeveloperLx的优秀开源项目:LxGridView  
10 - github链接:https://github.com/DeveloperLx/LxGridView  
11 - 我对这个类的代码做了一些修改;  
12 - 感谢DeveloperLx的优秀代码~  
13 - */  
14 -  
15 -@interface LxGridViewFlowLayout : UICollectionViewFlowLayout  
16 -  
17 -@property (nonatomic,assign) BOOL panGestureRecognizerEnable;  
18 -  
19 -@end  
20 -  
21 -@protocol LxGridViewDataSource <UICollectionViewDataSource>  
22 -  
23 -@optional  
24 -  
25 -- (void)collectionView:(UICollectionView *)collectionView  
26 - itemAtIndexPath:(NSIndexPath *)sourceIndexPath  
27 - willMoveToIndexPath:(NSIndexPath *)destinationIndexPath;  
28 -- (void)collectionView:(UICollectionView *)collectionView  
29 - itemAtIndexPath:(NSIndexPath *)sourceIndexPath  
30 - didMoveToIndexPath:(NSIndexPath *)destinationIndexPath;  
31 -  
32 -- (BOOL)collectionView:(UICollectionView *)collectionView  
33 -canMoveItemAtIndexPath:(NSIndexPath *)indexPath;  
34 -- (BOOL)collectionView:(UICollectionView *)collectionView  
35 - itemAtIndexPath:(NSIndexPath *)sourceIndexPath  
36 - canMoveToIndexPath:(NSIndexPath *)destinationIndexPath;  
37 -  
38 -@end  
39 -  
40 -@protocol LxGridViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout>  
41 -  
42 -@optional  
43 -  
44 -- (void)collectionView:(UICollectionView *)collectionView  
45 - layout:(UICollectionViewLayout *)collectionViewLayout  
46 -willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;  
47 -- (void)collectionView:(UICollectionView *)collectionView  
48 - layout:(UICollectionViewLayout *)collectionViewLayout  
49 -didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;  
50 -- (void)collectionView:(UICollectionView *)collectionView  
51 - layout:(UICollectionViewLayout *)collectionViewLayout  
52 -willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;  
53 -- (void)collectionView:(UICollectionView *)collectionView  
54 - layout:(UICollectionViewLayout *)collectionViewLayout  
55 -didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;  
56 -  
57 -@end  
58 \ No newline at end of file 0 \ No newline at end of file
CNLiveCMineModule/Classes/TZPhotoCell/LxGridViewFlowLayout.m deleted 100755 → 0
1 -//  
2 -// LxGridViewFlowLayout.m  
3 -// LxGridView  
4 -//  
5 -  
6 -#import "LxGridViewFlowLayout.h"  
7 -#import "TZTestNewCell.h"  
8 -#import "UIView+TZLayout.h"  
9 -  
10 -#define stringify __STRING  
11 -  
12 -static CGFloat const PRESS_TO_MOVE_MIN_DURATION = 0.1;  
13 -static CGFloat const MIN_PRESS_TO_BEGIN_EDITING_DURATION = 0.6;  
14 -  
15 -CG_INLINE CGPoint CGPointOffset(CGPoint point, CGFloat dx, CGFloat dy)  
16 -{  
17 - return CGPointMake(point.x + dx, point.y + dy);  
18 -}  
19 -  
20 -/*  
21 - 此类来源于DeveloperLx的优秀开源项目:LxGridView  
22 - github链接:https://github.com/DeveloperLx/LxGridView  
23 - 我对这个类的代码做了一些修改;  
24 - 感谢DeveloperLx的优秀代码~  
25 - */  
26 -  
27 -@interface LxGridViewFlowLayout () <UIGestureRecognizerDelegate>  
28 -  
29 -@property (nonatomic,readonly) id<LxGridViewDataSource> dataSource;  
30 -@property (nonatomic,readonly) id<LxGridViewDelegateFlowLayout> delegate;  
31 -  
32 -@end  
33 -  
34 -@implementation LxGridViewFlowLayout  
35 -{  
36 - UILongPressGestureRecognizer * _longPressGestureRecognizer;  
37 - UIPanGestureRecognizer * _panGestureRecognizer;  
38 - NSIndexPath * _movingItemIndexPath;  
39 - UIView * _beingMovedPromptView;  
40 - CGPoint _sourceItemCollectionViewCellCenter;  
41 -  
42 - CADisplayLink * _displayLink;  
43 - CFTimeInterval _remainSecondsToBeginEditing;  
44 -}  
45 -  
46 -#pragma mark - setup  
47 -  
48 -- (void)dealloc  
49 -{  
50 - [_displayLink invalidate];  
51 -  
52 - [self removeGestureRecognizers];  
53 - [self removeObserver:self forKeyPath:@stringify(collectionView)];  
54 -}  
55 -  
56 -- (instancetype)init  
57 -{  
58 - if (self = [super init]) {  
59 - [self setup];  
60 - }  
61 - return self;  
62 -}  
63 -  
64 -- (instancetype)initWithCoder:(NSCoder *)coder  
65 -{  
66 - if (self = [super initWithCoder:coder]) {  
67 - [self setup];  
68 - }  
69 - return self;  
70 -}  
71 -  
72 -- (void)setup  
73 -{  
74 - [self addObserver:self forKeyPath:@stringify(collectionView) options:NSKeyValueObservingOptionNew context:nil];  
75 -}  
76 -  
77 -- (void)addGestureRecognizers  
78 -{  
79 - self.collectionView.userInteractionEnabled = YES;  
80 -  
81 - _longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPressGestureRecognizerTriggerd:)];  
82 - _longPressGestureRecognizer.cancelsTouchesInView = NO;  
83 - _longPressGestureRecognizer.minimumPressDuration = PRESS_TO_MOVE_MIN_DURATION;  
84 - _longPressGestureRecognizer.delegate = self;  
85 -  
86 - for (UIGestureRecognizer * gestureRecognizer in self.collectionView.gestureRecognizers) {  
87 - if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {  
88 - [gestureRecognizer requireGestureRecognizerToFail:_longPressGestureRecognizer];  
89 - }  
90 - }  
91 -  
92 - [self.collectionView addGestureRecognizer:_longPressGestureRecognizer];  
93 -  
94 - _panGestureRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panGestureRecognizerTriggerd:)];  
95 - _panGestureRecognizer.delegate = self;  
96 - [self.collectionView addGestureRecognizer:_panGestureRecognizer];  
97 -  
98 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:nil];  
99 -}  
100 -  
101 -- (void)removeGestureRecognizers  
102 -{  
103 - if (_longPressGestureRecognizer) {  
104 - if (_longPressGestureRecognizer.view) {  
105 - [_longPressGestureRecognizer.view removeGestureRecognizer:_longPressGestureRecognizer];  
106 - }  
107 - _longPressGestureRecognizer = nil;  
108 - }  
109 -  
110 - if (_panGestureRecognizer) {  
111 - if (_panGestureRecognizer.view) {  
112 - [_panGestureRecognizer.view removeGestureRecognizer:_panGestureRecognizer];  
113 - }  
114 - _panGestureRecognizer = nil;  
115 - }  
116 -  
117 - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil];  
118 -}  
119 -  
120 -#pragma mark - getter and setter implementation  
121 -  
122 -- (id<LxGridViewDataSource>)dataSource  
123 -{  
124 - return (id<LxGridViewDataSource>)self.collectionView.dataSource;  
125 -}  
126 -  
127 -- (id<LxGridViewDelegateFlowLayout>)delegate  
128 -{  
129 - return (id<LxGridViewDelegateFlowLayout>)self.collectionView.delegate;  
130 -}  
131 -  
132 -#pragma mark - override UICollectionViewLayout methods  
133 -  
134 -- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect  
135 -{  
136 - NSArray * layoutAttributesForElementsInRect = [super layoutAttributesForElementsInRect:rect];  
137 -  
138 - for (UICollectionViewLayoutAttributes * layoutAttributes in layoutAttributesForElementsInRect) {  
139 -  
140 - if (layoutAttributes.representedElementCategory == UICollectionElementCategoryCell) {  
141 - layoutAttributes.hidden = [layoutAttributes.indexPath isEqual:_movingItemIndexPath];  
142 - }  
143 - }  
144 - return layoutAttributesForElementsInRect;  
145 -}  
146 -  
147 -- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath  
148 -{  
149 - UICollectionViewLayoutAttributes * layoutAttributes = [super layoutAttributesForItemAtIndexPath:indexPath];  
150 - if (layoutAttributes.representedElementCategory == UICollectionElementCategoryCell) {  
151 - layoutAttributes.hidden = [layoutAttributes.indexPath isEqual:_movingItemIndexPath];  
152 - }  
153 - return layoutAttributes;  
154 -}  
155 -  
156 -#pragma mark - gesture  
157 -  
158 -- (void)setPanGestureRecognizerEnable:(BOOL)panGestureRecognizerEnable  
159 -{  
160 - _panGestureRecognizer.enabled = panGestureRecognizerEnable;  
161 -}  
162 -  
163 -- (BOOL)panGestureRecognizerEnable  
164 -{  
165 - return _panGestureRecognizer.enabled;  
166 -}  
167 -  
168 -- (void)longPressGestureRecognizerTriggerd:(UILongPressGestureRecognizer *)longPress  
169 -{  
170 - switch (longPress.state) {  
171 - case UIGestureRecognizerStatePossible:  
172 - break;  
173 - case UIGestureRecognizerStateBegan:  
174 - {  
175 - if (_displayLink == nil) {  
176 - _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkTriggered:)];  
177 - _displayLink.frameInterval = 6;  
178 - [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];  
179 -  
180 - _remainSecondsToBeginEditing = MIN_PRESS_TO_BEGIN_EDITING_DURATION;  
181 - }  
182 -  
183 - _movingItemIndexPath = [self.collectionView indexPathForItemAtPoint:[longPress locationInView:self.collectionView]];  
184 - if ([self.dataSource respondsToSelector:@selector(collectionView:canMoveItemAtIndexPath:)] && [self.dataSource collectionView:self.collectionView canMoveItemAtIndexPath:_movingItemIndexPath] == NO) {  
185 - _movingItemIndexPath = nil;  
186 - return;  
187 - }  
188 -  
189 - if ([self.delegate respondsToSelector:@selector(collectionView:layout:willBeginDraggingItemAtIndexPath:)]) {  
190 - [self.delegate collectionView:self.collectionView layout:self willBeginDraggingItemAtIndexPath:_movingItemIndexPath];  
191 - }  
192 -  
193 - UICollectionViewCell *sourceCollectionViewCell = [self.collectionView cellForItemAtIndexPath:_movingItemIndexPath];  
194 - TZTestNewCell *sourceCell = (TZTestNewCell *)sourceCollectionViewCell;  
195 -  
196 - _beingMovedPromptView = [[UIView alloc]initWithFrame:CGRectOffset(sourceCollectionViewCell.frame, -10, -10)];  
197 - _beingMovedPromptView.tz_width += 20;  
198 - _beingMovedPromptView.tz_height += 20;  
199 -  
200 - sourceCollectionViewCell.highlighted = YES;  
201 - UIView * highlightedSnapshotView = [sourceCell snapshotView];  
202 - highlightedSnapshotView.frame = _beingMovedPromptView.bounds;  
203 - highlightedSnapshotView.alpha = 1;  
204 -  
205 - sourceCollectionViewCell.highlighted = NO;  
206 - UIView * snapshotView = [sourceCell snapshotView];  
207 - snapshotView.frame = _beingMovedPromptView.bounds;  
208 - snapshotView.alpha = 0;  
209 -  
210 - [_beingMovedPromptView addSubview:snapshotView];  
211 - [_beingMovedPromptView addSubview:highlightedSnapshotView];  
212 - [self.collectionView addSubview:_beingMovedPromptView];  
213 -  
214 - _sourceItemCollectionViewCellCenter = sourceCollectionViewCell.center;  
215 -  
216 - typeof(self) __weak weakSelf = self;  
217 - [UIView animateWithDuration:0  
218 - delay:0  
219 - options:UIViewAnimationOptionBeginFromCurrentState  
220 - animations:^{  
221 -  
222 - typeof(self) __strong strongSelf = weakSelf;  
223 - if (strongSelf) {  
224 - highlightedSnapshotView.alpha = 0;  
225 - snapshotView.alpha = 1;  
226 - }  
227 - }  
228 - completion:^(BOOL finished) {  
229 -  
230 - typeof(self) __strong strongSelf = weakSelf;  
231 - if (strongSelf) {  
232 - [highlightedSnapshotView removeFromSuperview];  
233 -  
234 - if ([strongSelf.delegate respondsToSelector:@selector(collectionView:layout:didBeginDraggingItemAtIndexPath:)]) {  
235 - [strongSelf.delegate collectionView:strongSelf.collectionView layout:strongSelf didBeginDraggingItemAtIndexPath:_movingItemIndexPath];  
236 - }  
237 - }  
238 - }];  
239 -  
240 - [self invalidateLayout];  
241 - }  
242 - break;  
243 - case UIGestureRecognizerStateChanged:  
244 - break;  
245 - case UIGestureRecognizerStateEnded:  
246 - case UIGestureRecognizerStateCancelled:  
247 - {  
248 - [_displayLink invalidate];  
249 - _displayLink = nil;  
250 -  
251 - NSIndexPath * movingItemIndexPath = _movingItemIndexPath;  
252 -  
253 - if (movingItemIndexPath) {  
254 - if ([self.delegate respondsToSelector:@selector(collectionView:layout:willEndDraggingItemAtIndexPath:)]) {  
255 - [self.delegate collectionView:self.collectionView layout:self willEndDraggingItemAtIndexPath:movingItemIndexPath];  
256 - }  
257 -  
258 - _movingItemIndexPath = nil;  
259 - _sourceItemCollectionViewCellCenter = CGPointZero;  
260 -  
261 - UICollectionViewLayoutAttributes * movingItemCollectionViewLayoutAttributes = [self layoutAttributesForItemAtIndexPath:movingItemIndexPath];  
262 -  
263 - _longPressGestureRecognizer.enabled = NO;  
264 -  
265 - typeof(self) __weak weakSelf = self;  
266 - [UIView animateWithDuration:0.2  
267 - delay:0  
268 - options:UIViewAnimationOptionBeginFromCurrentState  
269 - animations:^{  
270 - typeof(self) __strong strongSelf = weakSelf;  
271 - if (strongSelf) {  
272 - _beingMovedPromptView.center = movingItemCollectionViewLayoutAttributes.center;  
273 - }  
274 - }  
275 - completion:^(BOOL finished) {  
276 -  
277 - _longPressGestureRecognizer.enabled = YES;  
278 -  
279 - typeof(self) __strong strongSelf = weakSelf;  
280 - if (strongSelf) {  
281 - [_beingMovedPromptView removeFromSuperview];  
282 - _beingMovedPromptView = nil;  
283 - [strongSelf invalidateLayout];  
284 -  
285 - if ([strongSelf.delegate respondsToSelector:@selector(collectionView:layout:didEndDraggingItemAtIndexPath:)]) {  
286 - [strongSelf.delegate collectionView:strongSelf.collectionView layout:strongSelf didEndDraggingItemAtIndexPath:movingItemIndexPath];  
287 - }  
288 - }  
289 - }];  
290 - }  
291 - }  
292 - break;  
293 - case UIGestureRecognizerStateFailed:  
294 - break;  
295 - default:  
296 - break;  
297 - }  
298 -}  
299 -  
300 -  
301 -- (void)panGestureRecognizerTriggerd:(UIPanGestureRecognizer *)pan  
302 -{  
303 -  
304 - switch (pan.state) {  
305 - case UIGestureRecognizerStatePossible:  
306 - break;  
307 - case UIGestureRecognizerStateBegan:  
308 - case UIGestureRecognizerStateChanged:  
309 - {  
310 - CGPoint panTranslation = [pan translationInView:self.collectionView];  
311 - _beingMovedPromptView.center = CGPointOffset(_sourceItemCollectionViewCellCenter, panTranslation.x, panTranslation.y);  
312 -  
313 - NSIndexPath * sourceIndexPath = _movingItemIndexPath;  
314 - NSIndexPath * destinationIndexPath = [self.collectionView indexPathForItemAtPoint:_beingMovedPromptView.center];  
315 -  
316 - if ((destinationIndexPath == nil) || [destinationIndexPath isEqual:sourceIndexPath]) {  
317 - return;  
318 - }  
319 -  
320 - if ([self.dataSource respondsToSelector:@selector(collectionView:itemAtIndexPath:canMoveToIndexPath:)] && [self.dataSource collectionView:self.collectionView itemAtIndexPath:sourceIndexPath canMoveToIndexPath:destinationIndexPath] == NO) {  
321 - return;  
322 - }  
323 -  
324 - if ([self.dataSource respondsToSelector:@selector(collectionView:itemAtIndexPath:willMoveToIndexPath:)]) {  
325 - [self.dataSource collectionView:self.collectionView itemAtIndexPath:sourceIndexPath willMoveToIndexPath:destinationIndexPath];  
326 - }  
327 -  
328 - _movingItemIndexPath = destinationIndexPath;  
329 -  
330 - typeof(self) __weak weakSelf = self;  
331 - [self.collectionView performBatchUpdates:^{  
332 - typeof(self) __strong strongSelf = weakSelf;  
333 - if (strongSelf) {  
334 - if (sourceIndexPath && destinationIndexPath) {  
335 - [strongSelf.collectionView deleteItemsAtIndexPaths:@[sourceIndexPath]];  
336 - [strongSelf.collectionView insertItemsAtIndexPaths:@[destinationIndexPath]];  
337 - }  
338 - }  
339 - } completion:^(BOOL finished) {  
340 - typeof(self) __strong strongSelf = weakSelf;  
341 - if ([strongSelf.dataSource respondsToSelector:@selector(collectionView:itemAtIndexPath:didMoveToIndexPath:)]) {  
342 - [strongSelf.dataSource collectionView:strongSelf.collectionView itemAtIndexPath:sourceIndexPath didMoveToIndexPath:destinationIndexPath];  
343 - }  
344 - }];  
345 - }  
346 - break;  
347 - case UIGestureRecognizerStateEnded:  
348 - break;  
349 - case UIGestureRecognizerStateCancelled:  
350 - break;  
351 - case UIGestureRecognizerStateFailed:  
352 - break;  
353 - default:  
354 - break;  
355 - }  
356 -}  
357 -  
358 -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer  
359 -{  
360 - if ([_panGestureRecognizer isEqual:gestureRecognizer]) {  
361 - return _movingItemIndexPath != nil;  
362 - }  
363 - return [self panGestureRecognizerEnable];  
364 -}  
365 -  
366 -- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer  
367 -{  
368 - // only _longPressGestureRecognizer and _panGestureRecognizer can recognize simultaneously  
369 - if ([_longPressGestureRecognizer isEqual:gestureRecognizer]) {  
370 - return [_panGestureRecognizer isEqual:otherGestureRecognizer];  
371 - }  
372 - if ([_panGestureRecognizer isEqual:gestureRecognizer]) {  
373 - return [_longPressGestureRecognizer isEqual:otherGestureRecognizer];  
374 - }  
375 - return NO;  
376 -}  
377 -  
378 -#pragma mark - displayLink  
379 -  
380 -- (void)displayLinkTriggered:(CADisplayLink *)displayLink  
381 -{  
382 - if (_remainSecondsToBeginEditing <= 0) {  
383 - [_displayLink invalidate];  
384 - _displayLink = nil;  
385 - }  
386 -  
387 - _remainSecondsToBeginEditing = _remainSecondsToBeginEditing - 0.1;  
388 -}  
389 -  
390 -#pragma mark - KVO and notification  
391 -  
392 -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context  
393 -{  
394 - if ([keyPath isEqualToString:@stringify(collectionView)]) {  
395 - if (self.collectionView) {  
396 - [self addGestureRecognizers];  
397 - }  
398 - else {  
399 - [self removeGestureRecognizers];  
400 - }  
401 - }  
402 -}  
403 -  
404 -- (void)applicationWillResignActive:(NSNotification *)notificaiton  
405 -{  
406 - _panGestureRecognizer.enabled = NO;  
407 - _panGestureRecognizer.enabled = YES;  
408 -}  
409 -  
410 -@end  
CNLiveCMineModule/Classes/TZPhotoCell/TZTestNewCell.h deleted 100644 → 0
1 -//  
2 -// TZTestNewCell.h  
3 -// CNLiveNetAdd  
4 -//  
5 -// Created by open on 2021/6/17.  
6 -// Copyright © 2021 cnlive. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -NS_ASSUME_NONNULL_BEGIN  
12 -  
13 -@interface TZTestNewCell : UICollectionViewCell  
14 -@property (nonatomic, strong) UIImageView *imageView;  
15 -@property (nonatomic, strong) UIImageView *videoImageView;  
16 -@property (nonatomic, strong) UIButton *deleteBtn;  
17 -@property (nonatomic, strong) UILabel *gifLable;  
18 -@property (nonatomic, assign) NSInteger row;  
19 -@property (nonatomic, strong) id asset;  
20 -  
21 -//zx  
22 -@property (nonatomic, strong) UILabel *addPicLable;  
23 -- (UIView *)snapshotView;  
24 -@end  
25 -  
26 -NS_ASSUME_NONNULL_END  
CNLiveCMineModule/Classes/TZPhotoCell/TZTestNewCell.m deleted 100644 → 0
1 -//  
2 -// TZTestNewCell.m  
3 -// CNLiveNetAdd  
4 -//  
5 -// Created by open on 2021/6/17.  
6 -// Copyright © 2021 cnlive. All rights reserved.  
7 -//  
8 -  
9 -#import "TZTestNewCell.h"  
10 -#import "UIView+TZLayout.h"  
11 -#import <Photos/Photos.h>  
12 -#import <AssetsLibrary/AssetsLibrary.h>  
13 -#import "TZImagePickerController.h"  
14 -#import "UIColor+CNLiveExtension.h"  
15 -  
16 -@implementation TZTestNewCell  
17 -- (instancetype)initWithFrame:(CGRect)frame {  
18 - self = [super initWithFrame:frame];  
19 - if (self) {  
20 - self.backgroundColor = [UIColor whiteColor];  
21 - _imageView = [[UIImageView alloc] init];  
22 - _imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500];  
23 - _imageView.contentMode = UIViewContentModeScaleAspectFill;  
24 - [self addSubview:_imageView];  
25 - self.clipsToBounds = YES;  
26 -  
27 - _videoImageView = [[UIImageView alloc] init];  
28 - _videoImageView.image = [UIImage imageNamed:@"fb_bof"];//[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay"]  
29 - _videoImageView.contentMode = UIViewContentModeScaleAspectFill;  
30 - _videoImageView.hidden = YES;  
31 - [self addSubview:_videoImageView];  
32 -  
33 - _deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];  
34 - [_deleteBtn setImage:[UIImage imageNamed:@"fb_shanchu"] forState:UIControlStateNormal];//photo_delete  
35 - _deleteBtn.imageEdgeInsets = UIEdgeInsetsMake(-10, 0, 0, -10);  
36 - _deleteBtn.alpha = 0.6;  
37 - [self addSubview:_deleteBtn];  
38 -  
39 - _gifLable = [[UILabel alloc] init];  
40 - _gifLable.text = @"GIF";  
41 - _gifLable.textColor = [UIColor whiteColor];  
42 - _gifLable.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];  
43 - _gifLable.textAlignment = NSTextAlignmentCenter;  
44 - _gifLable.font = [UIFont systemFontOfSize:10];  
45 - [self addSubview:_gifLable];  
46 -  
47 - _addPicLable = [[UILabel alloc] init];  
48 - _addPicLable.text = @"";  
49 - _addPicLable.textColor = CNLiveColorWithHexString(@"#FFAAAAAA");  
50 - _addPicLable.textAlignment = NSTextAlignmentCenter;  
51 - _addPicLable.font = [UIFont systemFontOfSize:12];  
52 - [self addSubview:_addPicLable];  
53 - _addPicLable.hidden = YES;  
54 - }  
55 - return self;  
56 -}  
57 -  
58 -- (void)layoutSubviews {  
59 - [super layoutSubviews];  
60 - _imageView.frame = self.bounds;  
61 - _gifLable.frame = CGRectMake(self.tz_width - 25, self.tz_height - 14, 25, 14);  
62 - _deleteBtn.frame = CGRectMake(self.tz_width - 36, 0, 36, 36);  
63 - CGFloat width = self.tz_width / 3.0;  
64 - _videoImageView.frame = CGRectMake(width, width, width, width);  
65 - [_addPicLable mas_makeConstraints:^(MASConstraintMaker *make) {  
66 - make.centerX.mas_equalTo(self.mas_centerX);  
67 - make.bottom.mas_equalTo(self.mas_bottom).mas_offset(-24);  
68 - }];  
69 -}  
70 -  
71 -- (void)setAsset:(id)asset {  
72 - _asset = asset;  
73 - if ([asset isKindOfClass:[PHAsset class]]) {  
74 - PHAsset *phAsset = asset;  
75 - _videoImageView.hidden = phAsset.mediaType != PHAssetMediaTypeVideo;  
76 - _gifLable.hidden = ![[phAsset valueForKey:@"filename"] cn_containsString:@"GIF"];  
77 - } else if ([asset isKindOfClass:[ALAsset class]]) {  
78 - ALAsset *alAsset = asset;  
79 - _videoImageView.hidden = ![[alAsset valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo];  
80 - _gifLable.hidden = YES;  
81 - }  
82 - }  
83 -  
84 -- (void)setRow:(NSInteger)row {  
85 - _row = row;  
86 - _deleteBtn.tag = row;  
87 -}  
88 -  
89 -- (UIView *)snapshotView {  
90 - UIView *snapshotView = [[UIView alloc]init];  
91 -  
92 - UIView *cellSnapshotView = nil;  
93 -  
94 - if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) {  
95 - cellSnapshotView = [self snapshotViewAfterScreenUpdates:NO];  
96 - } else {  
97 - CGSize size = CGSizeMake(self.bounds.size.width + 20, self.bounds.size.height + 20);  
98 - UIGraphicsBeginImageContextWithOptions(size, self.opaque, 0);  
99 - [self.layer renderInContext:UIGraphicsGetCurrentContext()];  
100 - UIImage * cellSnapshotImage = UIGraphicsGetImageFromCurrentImageContext();  
101 - UIGraphicsEndImageContext();  
102 - cellSnapshotView = [[UIImageView alloc]initWithImage:cellSnapshotImage];  
103 - }  
104 -  
105 - snapshotView.frame = CGRectMake(0, 0, cellSnapshotView.frame.size.width, cellSnapshotView.frame.size.height);  
106 - cellSnapshotView.frame = CGRectMake(0, 0, cellSnapshotView.frame.size.width, cellSnapshotView.frame.size.height);  
107 -  
108 - [snapshotView addSubview:cellSnapshotView];  
109 - return snapshotView;  
110 -}  
111 -  
112 -@end  
CNLiveCMineModule/Classes/TZPhotoCell/Tools/ZXConst.h deleted 100644 → 0
1 -// ZXConst.h :引用所有的全局常量  
2 -  
3 -#import <UIKit/UIKit.h>  
4 -  
5 -/** 通用的间距值 */  
6 -UIKIT_EXTERN CGFloat const ZXMargin;  
7 -  
8 -UIKIT_EXTERN CGFloat const ZXShareHeight;  
9 -//UIKIT_EXTERN CGFloat const iconViewHeight;//头像的高度  
10 -///** 视频tag2000 */  
11 -//UIKIT_EXTERN CGFloat const CNVideoTag;  
12 -//  
13 -///** 图片tag1000 */  
14 -//UIKIT_EXTERN CGFloat const CNPictureTag;  
15 -//  
16 -///** 网络请求超时时间 */  
17 -//UIKIT_EXTERN CGFloat const kTimeoutInterval;  
18 -//  
19 -//UIKIT_EXTERN CGFloat CNMaxContentLabelHeight;  
20 -  
21 -////////////////////////////////////////////////////////  
22 -//////////// App  
23 -////////////////////////////////////////////////////////  
24 -// AppStore中AppID用于跳转AppStore下载/评分  
25 -#define AppStoreAppId @"1337575478"  
26 -  
27 -// 请求查询app在AppStore的上架信息  
28 -#define AppStoreAppInfo @"https://itunes.apple.com/lookup?id=1337575478"  
29 -  
30 -// yes:显示欢迎页 no:不显示欢迎页  
31 -#define AppShowGuidePage @"no"//yes no  
32 -  
33 -//上传手机通讯录和生成订单二维码时,DES加密key  
34 -#define AppDESKey @"cnliveIm"  
CNLiveCMineModule/Classes/TZPhotoCell/Tools/ZXConst.m deleted 100644 → 0
1 -#import "ZXConst.h"  
2 -  
3 -/** 通用的间距值 */  
4 -CGFloat const ZXMargin = 10;  
5 -CGFloat const ZXShareHeight = 60;  
6 -CGFloat const iconViewHeight = 40;  
7 -/** 视频tag */  
8 -CGFloat const CNVideoTag = 2000;  
9 -  
10 -/** 图片tag */  
11 -CGFloat const CNPictureTag = 1000;  
12 -  
13 -/** 通用的小间距值 */  
14 -CGFloat const ZXSmallMargin = ZXMargin * 0.5;  
15 -  
16 -/** 网络请求超时时间 */  
17 -CGFloat const kTimeoutInterval = 10.0;  
18 -  
19 -/** 标题字体字号 */  
20 -CGFloat const kTitleFont = 16.0;  
21 -  
22 -/** 内容字体字号 */  
23 -CGFloat const kContentFont = 14.0;  
24 -  
25 -/** 详细内容字体字号 */  
26 -CGFloat const kDetailContentFont = 12.0;  
27 -  
28 -CGFloat CNMaxContentLabelHeight = 0;  
29 -  
Example/CNLiveCMineModule.xcodeproj/project.pbxproj
@@ -401,6 +401,7 @@ @@ -401,6 +401,7 @@
401 "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", 401 "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
402 "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework", 402 "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
403 "${PODS_ROOT}/TXIMSDK_iOS/ImSDK.framework", 403 "${PODS_ROOT}/TXIMSDK_iOS/ImSDK.framework",
  404 + "${BUILT_PRODUCTS_DIR}/TZImagePickerController/TZImagePickerController.framework",
404 "${BUILT_PRODUCTS_DIR}/YBImageBrowser/YBImageBrowser.framework", 405 "${BUILT_PRODUCTS_DIR}/YBImageBrowser/YBImageBrowser.framework",
405 "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework", 406 "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework",
406 "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", 407 "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework",
@@ -457,6 +458,7 @@ @@ -457,6 +458,7 @@
457 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", 458 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
458 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework", 459 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
459 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ImSDK.framework", 460 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ImSDK.framework",
  461 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TZImagePickerController.framework",
460 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YBImageBrowser.framework", 462 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YBImageBrowser.framework",
461 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework", 463 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework",
462 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", 464 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework",