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

[Feat] #78 - 활동 기록 API 연결 #83

Merged

Conversation

dlwogus0128
Copy link
Contributor

@dlwogus0128 dlwogus0128 commented Jan 11, 2023

🌱 작업한 내용

  • 활동 기록 api 연결

🌱 PR Point

  • 콘솔창에 constraints 관련한 오류가 계속 떴는데.. 알고보니 스택뷰 안의 요소들 너비, 스택뷰 전체의 너비를 이중으로 설정해 생긴 오류였습니다 ㅋㅋ 아놔
  • 연결 잘 됐는데 자꾸 400 error 떠서 봤더니.. 부호를 반대로 써놨었음.. 아놔 ㅋ
  • 인덱싱 하는 방법을 잘 몰라서.. "00:03:40"로 받은 값을 UI에 "0:03:40"으로 나타내야 할 때 -> .suffix(7)로 나타냈는데.. 더 좋은 방법이 있나요..?

📸 스크린샷

생략

📮 관련 이슈

@dlwogus0128 dlwogus0128 self-assigned this Jan 11, 2023
@dlwogus0128 dlwogus0128 added Feat 새로운 기능 구현 재현🐶 labels Jan 11, 2023
@dlwogus0128 dlwogus0128 changed the title [Feat] #78 - 활동 기록 api 연결 [Feat] #78 - 활동 기록 API 연결 Jan 11, 2023
Copy link
Collaborator

@lsj8706 lsj8706 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~!! 리뷰 반영해서 머지 해주세요!!


// MARK: - Record

struct Record: Codable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 친구 이름을 ActivityRecord 하는게 좋아보여요!

Comment on lines 98 to 107
// 날짜 바꾸기
let activityRecordDate = model.createdAt.prefix(10)
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
let convertDate = dateFormatter.date(from: String(activityRecordDate))
guard let convertDate = convertDate else { return }

let resultDateFormatter = DateFormatter()
resultDateFormatter.dateFormat = "yyyy.MM.dd"
let resultDate = resultDateFormatter.string(from: convertDate)
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 친구들은 따로 함수로 만드는게 좋아보여요!

RNTimeFormatter.swift 에 이런 시간 포매팅 관련 함수들을 모으고 있어서 거기에 만들어도 좋을 거 같아요!! 함수 앞에 static을 붙이면 RNTimeFormatter.만든함수() 이렇게 인스턴스를 만들지 않고 사용할 수 있어요!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

대박

Comment on lines 110 to 114
let activityRecordRunningTime = model.time.suffix(7)

// 평균 페이스 바꾸기
let activityRecordAveragePace = model.pace
let array = activityRecordAveragePace.split(separator: ":").map { String($0) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

이런 코드도 함수로 따로 빼서 만듭시다!

@dlwogus0128 dlwogus0128 merged commit e624b5b into Runnect:develop Jan 11, 2023
@dlwogus0128 dlwogus0128 deleted the feat/#78-활동-기록-API-연결 branch January 11, 2023 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현 재현🐶
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 활동 기록 API 연결
2 participants