Skip to content

Conversation

seoulboy
Copy link
Collaborator

@seoulboy seoulboy commented Dec 9, 2020

Issue Number

Close #88

변경사항

  • RunningInfo ViewModel 과 PausedRunning ViewModel 에서 RunningDataProvider의 motion type을 구독하도록 하고, 값에 따라 didTapPause 혹은 didTapResume 을 실행합니다.
  • 기존 커스텀 motion type을 삭제하고 CoreMotion의 ActivityType을 이용하는 방식으로 변경하였습니다.
    • 변경 사유: CMActivity의 confidence 값을 사용하여 motion type에 따른 정확도를 높이기 위해
  • 초당 케이던스로 제공되는 값을 분당 케이던스로 변환하였습니다
  • 칼로리와 케이던스는 하드웨어의 availability를 확인 후 없을 시에 RunningData에 --로 표시합니다.
    애플 공식문서 : CMMotionActivityConfidence

작업 유형

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

체크리스트

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

]

runningDataProvider.currentMotionType
.throttle(for: .seconds(1), scheduler: RunLoop.main, latest: true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

throttle, debounce 어떤 차이가 있나요?

@seoulboy seoulboy merged commit 2845a58 into master Dec 9, 2020
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.

Motion Type이 변경될 시 자동으로 러닝을 정지 / 재시작한다

3 participants