-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💊 싱글톤 객체로 생성하는 것 이외에,
@StateObject var viewModel = ScreenTimeViewModel()
이렇게 선언해서 받아주는 방법도 있더라고요~!
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💊 ChallengeDay 변수와 관련 로직을 ViewModel로 분리해도 좋을 것 같아요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오우 이런 실수를! 뷰 모델로 보내겠습니다!
public init(viewModel: ChallengeViewModel) { | ||
self.viewModel = viewModel | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💊 @ObservedObject, @StateObject 같은 것도 고려해보면 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 다음 PR에서 의존성 주입 고려하면서 다시 작성해볼게요!
There was a problem hiding this 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 수고하셨습니다!!
👾 작업 내용
DeviceActivityReport
extension 구현🚀 PR Point
HMH_iOS/HMH_iOS/HMH_iOS/Presentation/Challenge/ViewModels/ScreenTimeViewModel.swift
Lines 14 to 15 in b87f78a
DeviceActivityReport
외부의 타겟으로 앱 사용량 정보 전송이 어려워서 타겟 안에서 구현하는 것으로 옮기는 작업 중입니다. 해당 부분은 아직 완벽하게 구현되지는 않아, 구현 완료 되면 다시 공유드리겠습니다.HMH_iOS/HMH_iOS/HMHDeviceActivityReport/HMHDeviceActivityReport.swift
Lines 15 to 20 in 2442fe9
HMH_iOS/HMH_iOS/HMH_iOS/Presentation/Challenge/Views/ChallengeView.swift
Lines 86 to 89 in 2442fe9
📸 스크린샷
✅ CheckList
🔗 Issue
Resolved #21