//
|
// 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
|