//
|
// DYNovelController.m
|
// BuWanVideo2.0
|
//
|
// Created by aeline on 2022/1/15.
|
// Copyright © 2022 com.yeshi.buwansheque.ios. All rights reserved.
|
//
|
#import "DYNovelController.h"
|
#import "BDNovelPublicConfig.h"
|
|
@interface DYNovelController ()
|
@end
|
|
@implementation DYNovelController
|
- (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;
|
|
[self uploadReadDuration];
|
}
|
|
- (void) viewDidLoad{
|
[self buildCells];
|
}
|
|
- (void)buildCells {
|
//@{kBDNovelPageUserInfoFullScreen : @YES}
|
UIViewController *channel = [BDNovelPublicConfig novelViewControllerWithType:BDNovelPublicEnTranceTypeChannelPage userInfo:nil];
|
channel.view.frame=CGRectMake(0, 0, KScreenW, KScreenH - ALTabBar_H);
|
[self.view addSubview:channel.view];
|
|
[self addChildViewController:channel];
|
|
UIView *hidden=[[UIView alloc] init];
|
hidden.backgroundColor=UIColor.whiteColor;
|
hidden.frame=CGRectMake(0, kStatusBarH , KScreenW/10, ALNavBarH);
|
[self.view addSubview:hidden];
|
}
|
|
|
- (void) uploadReadDuration{
|
NSUInteger duration= [BDNovelPublicConfig getReadDuration];
|
if(duration<=0){
|
return;
|
}
|
|
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] readNovelEvent:duration :^(BOOL isSuccessful, id result, NSString *error) {
|
dispatch_semaphore_signal(semaphore);
|
}];
|
|
});
|
}
|
|
@end
|