Skip to content

Conversation

SHIVVVPP
Copy link
Collaborator

@SHIVVVPP SHIVVVPP commented Dec 8, 2020

Issue Number

Close #94 #93 #101

변경사항

  • Extensions
    • Date+DateRange
    • DateFormatter+Common
    • Date+String
  • Model
    • DateRange
      • ActivityScene에서 주, 월, 년, 전체 형태로 필터링 하는 기본 단위로 사용
    • ActivityFilterType
      • 주, 월, 년, 전체로 구분되어있는 enum 형태
      • 구분 별로 DateRange를 구할 수 있도록 내장 함수를 구현
      • 문자열로 출력할 수 있도록 내장 함수 구현
  • View
    • ActivityFilterVC
      • 기존 GoalTypeSheet과 다르게 하단의 TabBar를 가리지 않으면서 구현하기 위해 방안으로 TabBar의 높이를
        주입받아 상단에 표시하도록 함
    • DateFilterSheetView
      • 하단의 TabBar를 가리지 않고 등장하기위해 height를 조절하여 등장하도록 함
        또한 height를 조절하면 내부의 View들의 레이아웃이 깨지게 되므로 UIScrollView를 상속받아 구현
  • ViewModel
    • ActivityViewModel
      • 생성과 동시에 ActivityProvider를 주입받고 모든 통계데이터를 구하기 위해 모든 Activity를 받는다고 가정하고 구현
      • 모든 데이터를 받지만 최근 활동 5개만 표시하기 위해 따로 recentActivitiesSubject를 나누어 구현하였음
    • ActivityDateFilterViewModel
      • ActivityViewModel에서 ActivityFilterType, [DateRange](가지고 있는 filter에 따른 Range들), DateRange(현재 Range)
        를 주입받아 FilterType에 따라 PickerView에서 다르게 표시되도록 구현

새로운 기능

  • ActivityScene의 상단 TotalActivity Filter 선택 변경기능
  • Filter 변경시 등장하는 FilterSheet과 PickerView

작업 유형

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

체크리스트

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


class ActivityDateFilterViewController: UIViewController {
private lazy var backgroundView = UIView()
private lazy var sheetView = DateFilterSheetView(
Copy link
Collaborator

Choose a reason for hiding this comment

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

뷰 재활용하기에 좋은 방법인 것 같아요


import UIKit

class DateFilterSheetView: UIScrollView {
Copy link
Collaborator

Choose a reason for hiding this comment

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

스크롤뷰로 구현한 이유가 궁금합니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

저희 goalTypeSheet과는 다르게 TabBar가 보이면서 올라오는 환경인데
코디네이터 상에서 탭바 위로 화면을 띄우려먼 너무 번거로운작업을 거쳐야 해서
FilterSheet의 높이를 키워서 띄우는 화면을 구현하였는데
스크롤뷰를 사용 안하면 높이를 키울때 그 안에있는 자식 뷰들과의 위치관계가 어색해지기 때문에
실제로 올라오는것처럼 보이기 위해 스크롤 뷰를 사용했습니다.

}
}

func selfResizing() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

아래 두 메소드 호출을 안하면 무슨 일이 벌어지나요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

그 아래에서 frame 변경하는 부분은 frame.size.height = height 이렇게만 해주면 안되나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아 고쳐야겠네요 ㅎ

@SHIVVVPP SHIVVVPP merged commit aef8310 into master Dec 9, 2020
@SHIVVVPP SHIVVVPP deleted the feature/101 branch December 9, 2020 06:15
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.

[story #24] ActivityScene View 구현

3 participants