Commit a60321151bf59e8b358859abb15d7be2eb731ff8
1 parent
86930834
no message
Showing
6 changed files
with
31 additions
and
20 deletions
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| ... | ... | @@ -536,10 +536,12 @@ static CGFloat moveHeight = 50; |
| 536 | 536 | return subVC; |
| 537 | 537 | } |
| 538 | 538 | self.topBgImg.frame = CGRectMake(0, 0, KScreenWidth, self.topBgImgHeight - 50); |
| 539 | - CNLiveListManager *list = [[CNLiveListManager shareListManager] model:model black:isBlack]; | |
| 539 | + CNLiveListManager *list = [CNLiveListManager shareListManager]; | |
| 540 | + [list model:model black:isBlack]; | |
| 541 | + list.contentVC = self; | |
| 540 | 542 | weakself |
| 541 | 543 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 542 | - [self scrollViewUpDowm:isUp]; | |
| 544 | + [weakSelf scrollViewUpDowm:isUp]; | |
| 543 | 545 | }; |
| 544 | 546 | |
| 545 | 547 | return list; | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -140,11 +140,13 @@ |
| 140 | 140 | -(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index |
| 141 | 141 | { |
| 142 | 142 | CNCategoryGetChannelModel *model = self.pageListArr[index]; |
| 143 | - CNLiveListManager *list = [[CNLiveListManager shareListManager] model:model black:isBlack]; | |
| 143 | + CNLiveListManager *list = [CNLiveListManager shareListManager]; | |
| 144 | + [list model:model black:_isBlack]; | |
| 145 | + list.contentVC = self; | |
| 144 | 146 | weakself |
| 145 | 147 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 146 | 148 | !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp); |
| 147 | - }}; | |
| 149 | + }; | |
| 148 | 150 | |
| 149 | 151 | return list; |
| 150 | 152 | } | ... | ... |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveListManager.h
| ... | ... | @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN |
| 12 | 12 | |
| 13 | 13 | @interface CNLiveListManager : NSObject<JXCategoryListContentViewDelegate> |
| 14 | 14 | @property (nonatomic, copy) void (^scrollViewDidScrollBlock)(BOOL isUp); |
| 15 | +@property (nonatomic, weak) UIViewController *contentVC; | |
| 15 | 16 | |
| 16 | 17 | +(instancetype)shareListManager; |
| 17 | 18 | ... | ... |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveListManager.m
| ... | ... | @@ -14,11 +14,11 @@ |
| 14 | 14 | { |
| 15 | 15 | BOOL _black; |
| 16 | 16 | CNCategoryGetChannelModel *_model; |
| 17 | + CGFloat beginoffsetY; | |
| 17 | 18 | } |
| 18 | 19 | @end |
| 19 | 20 | |
| 20 | 21 | @implementation CNLiveListManager |
| 21 | - | |
| 22 | 22 | +(instancetype)shareListManager |
| 23 | 23 | { |
| 24 | 24 | static dispatch_once_t onceToken; |
| ... | ... | @@ -37,7 +37,16 @@ |
| 37 | 37 | } |
| 38 | 38 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging |
| 39 | 39 | { |
| 40 | - | |
| 40 | + if (isBeginDragging) { | |
| 41 | + beginoffsetY = scrollView.offsetY; | |
| 42 | + }else | |
| 43 | + { | |
| 44 | + if (scrollView.offsetY - beginoffsetY>2) { | |
| 45 | + !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(YES); | |
| 46 | + }else if (scrollView.offsetY - beginoffsetY<-2) { | |
| 47 | + !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(NO); | |
| 48 | + } | |
| 49 | + } | |
| 41 | 50 | } |
| 42 | 51 | |
| 43 | 52 | |
| ... | ... | @@ -62,15 +71,14 @@ |
| 62 | 71 | return vc.view; |
| 63 | 72 | } |
| 64 | 73 | NSDictionary * paramDic= @{ |
| 65 | - @"title": model.showName, | |
| 74 | + @"title": _model.showName, | |
| 66 | 75 | @"intercept": @(YES), |
| 67 | - @"isBlack":@(black) | |
| 76 | + @"isBlack":@(_black) | |
| 68 | 77 | |
| 69 | 78 | }; |
| 70 | 79 | CNLiveSubWebViewController *subVC = [CNLiveCWebViewModule showWebVCWithLunchForWebURL:_model.thirdUrl |
| 71 | 80 | ParamDict:paramDic ShowType:CNLiveWebViewLunchShowTypeHidden]; |
| 72 | - | |
| 73 | - | |
| 81 | + [self.contentVC addChildViewController:subVC]; | |
| 74 | 82 | return subVC.view; |
| 75 | 83 | } |
| 76 | 84 | @end | ... | ... |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveVideoClassifyProtocol.h
| 1 | 1 | // |
| 2 | 2 | // CNLiveVideoClassifyProtocol.h |
| 3 | -// Pods | |
| 3 | +// CNLiveVideoClassifyKit | |
| 4 | 4 | // |
| 5 | -// Created by CNLive on 2021/9/8. | |
| 6 | -// | |
| 7 | -/* CNLiveVideoClassifyProtocol_h */ | |
| 5 | +// Created by CNLive on 2021/9/9. | |
| 8 | 6 | // |
| 9 | 7 | |
| 10 | -/** | |
| 11 | - *与主工程交互 | |
| 12 | - */ | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | + | |
| 13 | 10 | @protocol CNLiveVideoClassifyProtocol <NSObject> |
| 14 | -//返回列表View | |
| 15 | --(UIView *)listView; | |
| 11 | + | |
| 12 | + | |
| 16 | 13 | |
| 17 | 14 | @end |
| 15 | + | ... | ... |
Example/CNLiveVideoClassifyKit/CNLiveWebViewModuleImpl.m
| ... | ... | @@ -116,7 +116,7 @@ |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging { |
| 119 | - [CNLiveListManager sha] | |
| 119 | + [[CNLiveListManager shareListManager] requestWebViewForScrollView:scrollView isBeginDragging:isBeginDragging]; | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | ... | ... |