Skip to content

Commit

Permalink
[MERGE] 커리큘럼메인에서 scrollToRow 분기처리(Team-LionHeart#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalswo2 authored Jul 21, 2023
2 parents 5d1e9bb + 0dcbc33 commit 67f05c7
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,26 @@ private extension CurriculumViewController {
guard let userInfoData else { return }

let userWeek = userInfoData.userWeekInfo
let weekPerMonth = 4
let desireSection = (userWeek / weekPerMonth) - 1
let desireRow = (userWeek % weekPerMonth)
let indexPath = IndexPath(row: desireRow, section: desireSection)

curriculumViewDatas[desireSection].weekDatas[desireRow].isExpanded = true
self.curriculumTableView.reloadData()
self.curriculumTableView.scrollToRow(at: indexPath, at: .top, animated: false)
if userWeek == 40 {
let weekPerMonth = 4
let desireSection = (userWeek / weekPerMonth) - 2
let desireRow = (userWeek % weekPerMonth)
let indexPath = IndexPath(row: desireRow, section: desireSection)

curriculumViewDatas[desireSection].weekDatas[desireRow+4].isExpanded = true
self.curriculumTableView.reloadData()
self.curriculumTableView.scrollToRow(at: indexPath, at: .top, animated: false)
} else {
let weekPerMonth = 4
let desireSection = (userWeek / weekPerMonth) - 1
let desireRow = (userWeek % weekPerMonth)
let indexPath = IndexPath(row: desireRow, section: desireSection)

curriculumViewDatas[desireSection].weekDatas[desireRow].isExpanded = true
self.curriculumTableView.reloadData()
self.curriculumTableView.scrollToRow(at: indexPath, at: .top, animated: false)
}
}

func configureUserInfoData() {
Expand Down

0 comments on commit 67f05c7

Please sign in to comment.