Commit 450ffb70806ec6757b70efbf66db754f66b8421c
1 parent
90e14087
0.7.4
Showing
2 changed files
with
15 additions
and
13 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/ClassifyCategory/view/CNCustomChannelListView.m
| ... | ... | @@ -35,6 +35,9 @@ static NSString * const headerIdentifier = @"CustomChannelsHeader"; |
| 35 | 35 | @end |
| 36 | 36 | |
| 37 | 37 | @implementation CNCustomChannelListView |
| 38 | +static UIView *snapshot = nil; | |
| 39 | +static NSIndexPath *sourceIndexPath = nil; | |
| 40 | + | |
| 38 | 41 | - (void)dealloc{ |
| 39 | 42 | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 40 | 43 | } |
| ... | ... | @@ -61,17 +64,20 @@ static NSString * const headerIdentifier = @"CustomChannelsHeader"; |
| 61 | 64 | [self addSubview:self.collectionView]; |
| 62 | 65 | [self.collectionView registerClass:[CNCustomChannelListCell class] forCellWithReuseIdentifier:reuseIdentifier]; |
| 63 | 66 | [self.collectionView registerClass:[CNCustomChannelListReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:headerIdentifier]; |
| 64 | - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDataAndRefresh) name:UIApplicationWillEnterForegroundNotification object:nil]; | |
| 67 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDataAndRefresh) name:UIApplicationDidBecomeActiveNotification object:nil]; | |
| 65 | 68 | [self getLocalDataAndRefresh]; |
| 66 | 69 | } |
| 67 | 70 | - (void)reloadDataAndRefresh{ |
| 68 | - [self finishAction:self.finishBtn] ; | |
| 69 | - [self getLocalDataAndRefresh]; | |
| 70 | - for (UIView *view in self.collectionView.subviews) { | |
| 71 | - if ([view isKindOfClass:[UIView class]]) { | |
| 72 | - [view removeFromSuperview]; | |
| 73 | - } | |
| 74 | - } | |
| 71 | + [snapshot removeFromSuperview]; | |
| 72 | + snapshot = nil; | |
| 73 | + CNCustomChannelListCell *cell = (CNCustomChannelListCell *)[self.collectionView cellForItemAtIndexPath:sourceIndexPath]; | |
| 74 | + | |
| 75 | + cell.hidden = NO; | |
| 76 | + cell.alpha = 1; | |
| 77 | + | |
| 78 | + self.isTopY = NO; | |
| 79 | + self.isBottomY = NO; | |
| 80 | + self.isMoveBegin = NO; | |
| 75 | 81 | } |
| 76 | 82 | - (void)layoutSubviews { |
| 77 | 83 | [super layoutSubviews]; |
| ... | ... | @@ -184,10 +190,6 @@ static NSString * const headerIdentifier = @"CustomChannelsHeader"; |
| 184 | 190 | location.y = bottomY; |
| 185 | 191 | } |
| 186 | 192 | } |
| 187 | - | |
| 188 | - static UIView *snapshot = nil; | |
| 189 | - static NSIndexPath *sourceIndexPath = nil; | |
| 190 | - | |
| 191 | 193 | switch (state) { |
| 192 | 194 | |
| 193 | 195 | case UIGestureRecognizerStateBegan: | ... | ... |