Skip to content
New issue

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

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

Already on GitHub? # to your account

[Feat/#21] 챌린지뷰 구현 및 스크린타임 API 연결 #28

Merged
merged 27 commits into from
May 14, 2024

Conversation

Zoe0929
Copy link
Member

@Zoe0929 Zoe0929 commented May 13, 2024

👾 작업 내용

  • 챌린지 뷰 구현
  • 포인트 뷰 구현
  • DeviceActivityReport extension 구현

🚀 PR Point

  • ❌ ❌ 완성이 아닙니다 ❌ ❌
  • 시뮬레이터에서는 앱 선택이 되지 않아서 스크린샷은 실기기만 남겨둡니다. 참고부탁드려요!
  • 브랜치 조절 실패로,, 하나의 PR에 너무 많은 내용이 담기게 되어 중간 점검으로 코드 리뷰 받고자 합니다.
  • ScreenTimeViewModel : 스크린 타임 사용 권한 설정, 모니터링 앱 설정등의 스크린타임 관련 로직을 모두 담았습니다.
    class ScreenTimeViewModel: ObservableObject {
    static let shared = ScreenTimeViewModel()
  • DeviceActivityReport 외부의 타겟으로 앱 사용량 정보 전송이 어려워서 타겟 안에서 구현하는 것으로 옮기는 작업 중입니다. 해당 부분은 아직 완벽하게 구현되지는 않아, 구현 완료 되면 다시 공유드리겠습니다.
    TotalActivityReport { totalActivity in
    TotalActivityView(totalActivity: totalActivity)
    }
    AppActivityReport { appActivity in
    AppActivityView(activityReport: appActivity)
    }
  • 아래처럼 구현하면, 텍스트에 스타일이 입혀지지 않는 오류가 발생하고 있습니다. 이는 애플 포럼에서도 계속 언급되는 문제인데, 해결 사례가 아직 없습니다. 우회해서 이름을 가져오는 작업을 했으나 잘 이뤄지지 않아서 타겟 안으로 옮기고 스타일이 적용되는지 확인이 필요합니다.
    Label(token)
    .labelStyle(.titleOnly)
    .font(.text5_medium_16)
    .foregroundStyle(.gray2)

📸 스크린샷

구현 내용 스크린샷
챌린지뷰 RPReplay_Final1715574244

✅ CheckList

  • 오류 없이 빌드되는지 확인
  • 로그용 print문 제거
  • 불필요한 주석 제거
  • 코드 컨벤션 확인

🔗 Issue

Resolved #21

@Zoe0929 Zoe0929 linked an issue May 13, 2024 that may be closed by this pull request
@Zoe0929 Zoe0929 requested a review from kim-seonwoo May 13, 2024 04:30
@Zoe0929 Zoe0929 self-assigned this May 13, 2024
@Zoe0929 Zoe0929 added 🐰지희 지희의 issue ✨FEAT 기능 구현 labels May 13, 2024
@Zoe0929 Zoe0929 added this to the 🔭2차 스프린트🪐 milestone May 13, 2024
Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

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

정말 고생 많으셨군요... 😭
좀만 더 파이팅 합시다아...



class ScreenTimeViewModel: ObservableObject {
static let shared = ScreenTimeViewModel()
Copy link
Member

Choose a reason for hiding this comment

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

💊 싱글톤 객체로 생성하는 것 이외에,
@StateObject var viewModel = ScreenTimeViewModel()
이렇게 선언해서 받아주는 방법도 있더라고요~!

Copy link
Member Author

Choose a reason for hiding this comment

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

여러 뷰에서 공용으로 사용해야해서 싱글톤으로 해봤는데, 이 방법이 더 좋은 것 같네요 굳굳!


struct PointView: View {
@State var viewModel = PointViewModel()
var challengeDay = 14
Copy link
Member

Choose a reason for hiding this comment

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

💊 ChallengeDay 변수와 관련 로직을 ViewModel로 분리해도 좋을 것 같아요!!

Copy link
Member Author

Choose a reason for hiding this comment

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

오우 이런 실수를! 뷰 모델로 보내겠습니다!

Comment on lines +22 to +24
public init(viewModel: ChallengeViewModel) {
self.viewModel = viewModel
}
Copy link
Member

Choose a reason for hiding this comment

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

💊 @ObservedObject, @StateObject 같은 것도 고려해보면 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

이 부분은 다음 PR에서 의존성 주입 고려하면서 다시 작성해볼게요!

@Zoe0929 Zoe0929 requested a review from kim-seonwoo May 13, 2024 16:54
Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

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

수고하셨습니다... 파이팅 항상..

import FamilyControls

struct ChallengeView: View {
@StateObject var screenTimeViewMode = ScreenTimeViewModel()
Copy link
Member

Choose a reason for hiding this comment

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

👍 수고하셨습니다!!

@Zoe0929 Zoe0929 merged commit 90bad1c into develop May 14, 2024
@Zoe0929 Zoe0929 deleted the feat/#21-ChallengeView branch June 19, 2024 02:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
✨FEAT 기능 구현 🐰지희 지희의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 챌린지뷰 구현
2 participants