| | |
| | | private var page:Int! |
| | | private var quarter:Int! |
| | | private var week:Int! |
| | | private var tableView:UITableView! |
| | | private var studyScheduleModel:StudyScheduleModel? |
| | | private(set) var tableView:UITableView! |
| | | var studyScheduleModel:StudyScheduleModel? |
| | | |
| | | required init(page:Int,quarter:Int,week:Int,studyScheduleModel:StudyScheduleModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | navigationItem.titleView = UIView() |
| | | // getData() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(Refresh_ListenSchedule_Noti).take(until: self.rx.deallocated).subscribe(onNext: {_ in |
| | | self.getData() |
| | | }).disposed(by: disposeBag) |
| | | // NotificationCenter.default.rx.notification(Refresh_ListenSchedule_Noti).take(until: self.rx.deallocated).subscribe(onNext: {_ in |
| | | // self.getData() |
| | | // }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func getData(){ |
| | | Services.studySchedule(week: week).subscribe(onNext: {data in |
| | | self.studyScheduleModel = data.data |
| | | self.tableView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | private func getData(force:Bool = false){ |
| | | |
| | | // if studyScheduleModel == nil || force{ |
| | | // Services.studySchedule(week: week).subscribe(onNext: {data in |
| | | // self.studyScheduleModel = data.data |
| | | // self.tableView.reloadData() |
| | | // }).disposed(by: disposeBag) |
| | | // } |
| | | |
| | | } |
| | | |
| | | func jumpAt(listenType:ListenType){ |
| | | let row = listenType.rawValue - 1 |
| | | var jumpIndex:IndexPath = IndexPath(row: row, section: 0) |
| | | let jumpIndex:IndexPath = IndexPath(row: row, section: 1) |
| | | tableView(self.tableView, didSelectRowAt: jumpIndex) |
| | | } |
| | | } |
| | |
| | | if page <= 4 && indexPath.section == 0{return} |
| | | |
| | | let day = page + 1 |
| | | sceneDelegate?.startTimer() |
| | | |
| | | if page <= 4{ |
| | | if indexPath.row == 0{ |
| | |
| | | if indexPath.row == 0{ |
| | | let fightVC = HomeListenFightVC(listenType: .game1,quarter: quarter,week: week,day: day) |
| | | fightVC.title = ListenType.game1.rawTitle |
| | | fightVC.studyScheduleModel = studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc:fightVC) |
| | | } |
| | | if indexPath.row == 1{ |