Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browse cell 일부 구현 #15

Merged
merged 13 commits into from
Nov 16, 2022
Merged

Browse cell 일부 구현 #15

merged 13 commits into from
Nov 16, 2022

Conversation

jinwoong16
Copy link
Collaborator

📕 Issue Number

Close #11 #10

📙 작업 내역

  • Browse Cell을 일부 구현하였습니다.

  • Browse Cell에 헤더를 이미지와 해당 유저이름이 나타나게 변경해야하는데, PR이 너무 커질 것 같아서 분할해서 올립니다. :)

  • QuestCell을 구현하였습니다. QuestCell 재구성 #10

📘 작업 유형

  • 신규 기능 추가
  • 버그 수정
  • 리펙토링
  • 문서 업데이트

📋 체크리스트

  • Merge 하는 브랜치가 올바른가?
  • 코딩컨벤션을 준수하는가?
  • PR과 관련없는 변경사항이 없는가?
  • 내 코드에 대한 자기 검토가 되었는가?
  • 변경사항이 효과적이거나 동작이 작동한다는 것을 보증하는 테스트를 추가하였는가?
  • 새로운 테스트와 기존의 테스트가 변경사항에 대해 만족하는가?

📝 PR 특이 사항

  • 회고때 언급하였던 부분입니다. 이후에도 계속 생각을 해보았는데... 날카로운 방법이 여전히 떠오르지 않았습니다. intrinsic content size를 사용하는 방법을 제안을 해주셔서 찾아보았으나, 아래의 코드의 숫자들이 그곳에 이동하는 형태가 될 것 같아서 코드작성을 하지 않았습니다. 😢
extension BrowseViewController {
    /**
     하나의 BrowseCell의 크기를 결정합니다. BrowseCell내의 QuestCell의 개수만큼 크기가 늘어납니다.
     +20은 margins으로 인해 추가된 값입니다.
     */
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return (75.0 * CGFloat(viewModel.cellCount[indexPath.row])) + 20 + 75
    }
}



@jinwoong16 jinwoong16 linked an issue Nov 16, 2022 that may be closed by this pull request
3 tasks
@jinwoong16 jinwoong16 merged commit 5180632 into develop Nov 16, 2022
guard let windowScene = (scene as? UIWindowScene) else { return }
let cont = BrowseViewController.create(with: BrowseViewModel())
self.window = UIWindow(windowScene: windowScene)
self.window?.rootViewController = cont
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 임시로 넣어놓은 부분일거라 생각이 되는데 나중에 코디네이터 구성이 완료되면 변경하면 될 것 같습니다!

Quest(title: "잠자기", startDay: Date(), endDay: Date(), repeat: 1, currentCount: 1, totalCount: 1)
]

let data: Observable<[(User, [Quest])]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typealias BrowseItem = (user:User, quests: [Quest]) 이런 식으로 각각 명칭을 지정해주면 사용할 때 조금 더 명확하게 사용할 수 있을 것 같습니다!


static let reuseIdentifier = "QuestCell"
/// dequeuResusable을 위한 아이덴티파이어입니다.
static let reuseIdentifier = "UserInfoCell"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserInfoCell부분 수정이 안 된 것같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 리팩터 브랜치만들고 바로 수정할게요 :)


final class QuestCell: UITableViewCell {
/// dequeuResusable을 위한 아이덴티파이어입니다.
static let reuseIdentifier = "UserInfoCell"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분도 수정이 안 된 것같습니다

인자로 받은 Entity Quest타입을 통해 그 정보를 기반으로 cell에 아이템을 넣습니다.

애니메이션 효과가 필요없다고 판단하여, `setProgress(_:animated)`에서 두번째 인자를
`false`로 설정하였습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QuestCell이 home view에서 사용 됐을 경우, 사용자가 터치했을 때에는 애니메이션이 있으면 좋을 것같다는 생각이 드는데 진웅님은 어떻게 생각하시나요?:)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 또 다른 부분에서 처리해도 되겠네요!

@jinwoong16 jinwoong16 deleted the feature/BrowseCell branch November 16, 2022 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browse Cell
2 participants