admin
2023-04-21 0b3a4aaf99ea251bc8e27b96115288f0988fcffe
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
//
//  DYNewsController.m
//  BuWanVideo2.0
//
//  Created by aeline on 2022/1/15.
//  Copyright © 2022 com.yeshi.buwansheque.ios. All rights reserved.
//
 
#import "DYNewsController.h"
#import <LCDSDK/LCDSDK.h>
 
@interface DYNewsController ()<LCDFeedExploreViewControllerDelegate,LCDAdvertCallBackProtocol>
@end
 
@implementation DYNewsController
- (instancetype)init {
    self = [super init];
    if (self) {
        self.title = @"发现";
    }
    return self;
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    self.navigationController.navigationBar.translucent = NO;
}
 
- (void) viewDidLoad{
    [self buildCells];
}
 
- (void)buildCells {
    
    LCDFeedExploreViewController *vc=[[LCDFeedExploreViewController alloc] initWithConfigBuilder:^(LCDFeedExploreVCConfig * _Nonnull config) {
        config.viewSize=CGSizeMake(KScreenW, KScreenH   - ALTabBar_H);
        config.delegate = self;
        config.adDelegate = self;
    }];
    
    [self.view addSubview:vc.view];
    [self addChildViewController:vc];
}
 
- (void)feedExploreGoToDetailPageEvent:(LCDEvent *)event controller:(LCDFeedExploreViewController *)feedExploreViewController{
    
    
    NSLog(@"draw video over play - group_id:%lld, params:%@", event.group_id, event.params);
    
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    // 创建全局并行
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    dispatch_group_t group = dispatch_group_create();
    dispatch_group_async(group, queue, ^{
        
        [[YTHNetInterface startInterface] readNewsEvent:^(BOOL isSuccessful, id result, NSString *error) {
            dispatch_semaphore_signal(semaphore);
        }];
        
    });
    
    
}
 
@end