Commit 90e14087073a8786462669814c1e3bf6973ebfe8
1 parent
bb7106cb
0.7.3
Showing
2 changed files
with
14 additions
and
4 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/ClassifyCategory/view/CNCustomChannelListView.m
| ... | ... | @@ -35,7 +35,9 @@ static NSString * const headerIdentifier = @"CustomChannelsHeader"; |
| 35 | 35 | @end |
| 36 | 36 | |
| 37 | 37 | @implementation CNCustomChannelListView |
| 38 | - | |
| 38 | +- (void)dealloc{ | |
| 39 | + [[NSNotificationCenter defaultCenter] removeObserver:self]; | |
| 40 | +} | |
| 39 | 41 | - (instancetype)initWithFrame:(CGRect)frame |
| 40 | 42 | { |
| 41 | 43 | self = [super initWithFrame:frame]; |
| ... | ... | @@ -59,10 +61,18 @@ static NSString * const headerIdentifier = @"CustomChannelsHeader"; |
| 59 | 61 | [self addSubview:self.collectionView]; |
| 60 | 62 | [self.collectionView registerClass:[CNCustomChannelListCell class] forCellWithReuseIdentifier:reuseIdentifier]; |
| 61 | 63 | [self.collectionView registerClass:[CNCustomChannelListReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:headerIdentifier]; |
| 62 | - | |
| 64 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDataAndRefresh) name:UIApplicationWillEnterForegroundNotification object:nil]; | |
| 63 | 65 | [self getLocalDataAndRefresh]; |
| 64 | 66 | } |
| 65 | - | |
| 67 | +- (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 | + } | |
| 75 | +} | |
| 66 | 76 | - (void)layoutSubviews { |
| 67 | 77 | [super layoutSubviews]; |
| 68 | 78 | ... | ... |