Commit 3dee27c9b582ed0bccafb8df828324db9311fb1e

Authored by yanglingyu
1 parent f45c8cea

0.5.1

CNLiveVideoClassifyKit.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveVideoClassifyKit'
11   - s.version = '0.5.0'
  11 + s.version = '0.5.1'
12 12 s.summary = '视讯头部一二级菜单组件'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveVideoClassifyKit/Classes/SearchView/ViewController/CNWitnessSearchDetailController.m
... ... @@ -117,13 +117,20 @@ static NSString *const CNWitnessSearchPersonCellID = @"CNWitnessSearchPersonCell
117 117 - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
118 118 return YES;
119 119 }
120   -#pragma KVO||Notification
  120 +#pragma mark - KVO||Notification
121 121 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
122 122 if ([keyPath isEqualToString:@"personMessage"]) {
123 123 NSDictionary *dic = change[NSKeyValueChangeNewKey];
124   - CNPersonMessageModel *model = [CNPersonMessageModel mj_objectWithKeyValues:dic];
125   - if ([self.personIDArray containsObject:model.id]) {
126   - NSInteger index = [self.personIDArray indexOfObject:model.id];
  124 + if ([self.personIDArray containsObject:dic[@"id"]]) {
  125 + NSInteger index = [self.personIDArray indexOfObject:dic[@"id"]];
  126 + CNPersonMessageModel *model = self.dataSource[index];
  127 + if ([dic[@"followStatus"] isEqualToString:@"0"] && model.focused) {
  128 + model.focused = NO;
  129 + model.fansNum -= 1;
  130 + }else if (([dic[@"followStatus"] isEqualToString:@"1"] ||[dic[@"followStatus"] isEqualToString:@"2"] )&& !model.focused){
  131 + model.focused = YES;
  132 + model.fansNum += 1;
  133 + }
127 134 [self.dataSource replaceObjectAtIndex:index withObject:model];
128 135 [self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]]];
129 136 }
... ...
CNLiveVideoClassifyKit/Classes/SearchView/ViewController/CNWitnessSearchListController.m
... ... @@ -68,7 +68,8 @@
68 68 self.listContainerView.scrollView.offsetX = lenth;
69 69 self.lineView.x = self.lineX + lenth/3;
70 70 } else if (gesture.state == UIGestureRecognizerStateEnded) {
71   - if (lenth >= sensitivePosition || gesture.numberOfTouches < 0.5) {
  71 + CGPoint speed = [gesture velocityInView:gesture.view];
  72 + if (lenth >= sensitivePosition || speed.x != 0) {
72 73 [self.myCategoryView selectItemAtIndex:1];
73 74 }else{
74 75 [self.listContainerView.scrollView setOffsetX:0
... ...
CNLiveVideoClassifyKit/Classes/SearchView/ViewController/CNWitnessSearchViewController.m
... ... @@ -94,7 +94,8 @@ static NSString *const CNWitnessSearchHeaderViewID = @&quot;CNWitnessSearchHeaderView
94 94 make.left.equalTo(self.view).offset(translation.x);
95 95 }];
96 96 } else if (gesture.state == UIGestureRecognizerStateEnded) {
97   - if (translation.x >= sensitivePosition || gesture.numberOfTouches < 0.5) {
  97 + CGPoint speed = [gesture velocityInView:gesture.view];
  98 + if (translation.x >= sensitivePosition || speed.x != 0) {
98 99 [self listViewShow:NO];
99 100 }else{
100 101 [self listViewShow:YES];
... ...