You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

89 lines
2.8 KiB

//
// TFCompleteViewController.m
// TFReader
//
// Created by 谢腾飞 on 2020/12/17.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import "TFCompleteViewController.h"
#import "TFCompleteCommController.h"
@interface TFCompleteViewController ()<
#if TF_Enable_PageControl
SGPageTitleViewDelegate,
#endif
SGPageContentCollectionViewDelegate>
#if TF_Enable_PageControl
@property (nonatomic ,strong) SGPageTitleView *pageTitleView;
#endif
@property (nonatomic ,strong) SGPageContentCollectionView *pageContentCollectionView;
@end
@implementation TFCompleteViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self initialize];
[self createSubviews];
}
- (void)initialize
{
[self setNavigationBarTitle:self.navTitle ? : TFLocalizedString(@"完结")];
[self hiddenSeparator];
}
- (void)createSubviews
{
TFCompleteCommController *boyVC = [[TFCompleteCommController alloc] init];
boyVC.productionType = self.productionType;
boyVC.channel = @"1";
#if TF_Enable_PageControl
TFCompleteCommController *girlVC = [[TFCompleteCommController alloc] init];
girlVC.productionType = self.productionType;
girlVC.channel = @"2";
#endif
NSArray *childArr = @[boyVC
#if TF_Enable_PageControl
, girlVC
#endif
];
self.pageContentCollectionView = [[SGPageContentCollectionView alloc] initWithFrame:
#if TF_Enable_PageControl
CGRectMake(0, PUB_NAVBAR_HEIGHT + 44, SCREEN_WIDTH, SCREEN_HEIGHT)
#else
CGRectMake(0, PUB_NAVBAR_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT)
#endif
parentVC:self childVCs:childArr];
_pageContentCollectionView.delegatePageContentCollectionView = self;
[self.view addSubview:self.pageContentCollectionView];
#if TF_Enable_PageControl
NSArray *titleArr = @[TFLocalizedString(@"男生"), TFLocalizedString(@"女生")];
self.pageTitleView = [SGPageTitleView pageTitleViewWithFrame:CGRectMake(0, PUB_NAVBAR_HEIGHT, SCREEN_WIDTH, 44) delegate:self titleNames:titleArr configure:self.pageConfigure];
self.pageTitleView.backgroundColor = kWhiteColor;
[self.view addSubview:_pageTitleView];
#endif
}
#if TF_Enable_PageControl
- (void)pageTitleView:(SGPageTitleView *)pageTitleView selectedIndex:(NSInteger)selectedIndex
{
[self.pageContentCollectionView setPageContentCollectionViewCurrentIndex:selectedIndex];
}
- (void)pageContentCollectionView:(SGPageContentCollectionView *)pageContentCollectionView progress:(CGFloat)progress originalIndex:(NSInteger)originalIndex targetIndex:(NSInteger)targetIndex
{
[self.pageTitleView setPageTitleViewWithProgress:progress originalIndex:originalIndex targetIndex:targetIndex];
}
#endif
@end