CNLiveListManager.m
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// CNLiveListManager.m
// CNLiveVideoClassifyKit
//
// Created by CNLive on 2021/9/8.
//
#import "CNLiveListManager.h"
#import "CNCategoryGetChannelModel.h"
#import "CNLiveClassifySegmentController.h"
@interface CNLiveListManager()
{
CGFloat beginoffsetY;
}
@end
@implementation CNLiveListManager
+(instancetype)shareListManager
{
static dispatch_once_t onceToken;
static CNLiveListManager *manager = nil;
dispatch_once(&onceToken, ^{
manager = [[CNLiveListManager alloc] init];
});
return manager;
}
+(CNCategoryBaseViewController *)CNCategoryBaseViewController
{
return [[CNLiveClassifySegmentController alloc] init];
}
-(UIViewController *)model:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(nonnull NSString *)bgColor bgImageH5:(nonnull NSString *)bgImageH5
{
NSDictionary * paramDic = nil;
if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){
paramDic= @{
@"title": model.showName?model.showName:@"",
@"bgColor": bgColor?bgColor:@"",
@"isBlack":@(black),
@"backgroundImg": bgImage?bgImage:@"",
@"channelId":model.channelId?model.channelId:@"",
@"channelName":model.id?model.id:@"",
@"pageId":model.pageId?model.pageId:@""
};
}else{
paramDic= @{
@"title": model.showName?model.showName:@"",
@"bgColor": bgColor?bgColor:@"",
@"isBlack":@(black),
@"thirdUrl":model.thirdUrl?model.thirdUrl:@"",
@"backgroundImgH5":bgImageH5?bgImageH5:@""
};
}
UIViewController *subVC = [CNLiveClassifyJumpBridge ListViewWithPageType:model.pageType.integerValue param:paramDic];
return subVC;
}
- (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging
{
if (isBeginDragging) {
beginoffsetY = scrollView.offsetY;
}else
{
if (scrollView.offsetY - beginoffsetY>5) {
!self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(YES);
}else if (scrollView.offsetY - beginoffsetY<0) {
!self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(NO);
}
}
}
@end