| | |
| | | |
| | | class WorldCupVC: BaseVC { |
| | | |
| | | private var partModels = [ActivityDetailPartModel](){ |
| | | didSet{ |
| | | currentPartModel = partModels.first |
| | | } |
| | | } |
| | | |
| | | private var currentPartModel:ActivityDetailPartModel?{ |
| | | didSet{ |
| | | headerVC.currentPartModel = currentPartModel |
| | | pageVC.reloadData() |
| | | } |
| | | } |
| | | |
| | | lazy var headerVC:WorldCupHeaderVC = { |
| | | let vc = WorldCupHeaderVC() |
| | | return vc |
| | |
| | | vc.style = .subRefresh |
| | | return vc |
| | | }() |
| | | |
| | | |
| | | lazy var pageVC:FFPageViewController = { |
| | | let pageViewController = FFPageViewController() |
| | |
| | | } |
| | | |
| | | menuVC.pageMenu.delegate = self |
| | | |
| | | Services.getParticipant().subscribe(onNext: {[weak self ]data in |
| | | if let items = data.data{ |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.partModels = items |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | if page <= 1{ |
| | | return WorldCupContentVC() |
| | | let contentVC = WorldCupContentVC(state:page + 1) |
| | | contentVC.currentPartModel = currentPartModel |
| | | return contentVC |
| | | }else if page == 2{ |
| | | return WorldCupRecordVC() |
| | | }else{ |